diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs index f6e35086e51c..13ad025f8861 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs @@ -1,5 +1,60 @@ namespace Azure.ResourceManager.NeonPostgres { + public partial class NeonBranchCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonBranchCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string branchName, 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 branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string branchName, 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 NeonBranchData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonBranchData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonBranchResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonBranchResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonBranchData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetComputes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetComputesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetEndpoints(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetEndpointsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetNeonDatabases(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetNeonDatabasesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetNeonRoles(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetNeonRolesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NeonOrganizationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NeonOrganizationCollection() { } @@ -41,6 +96,9 @@ protected NeonOrganizationResource() { } 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 GetNeonProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonProjectCollection GetNeonProjects() { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -55,12 +113,68 @@ protected NeonOrganizationResource() { } } public static partial class NeonPostgresExtensions { + public static Azure.ResourceManager.NeonPostgres.NeonBranchResource GetNeonBranchResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetNeonOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetNeonOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetNeonOrganizations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNeonOrganizationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonProjectResource GetNeonProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetPostgresVersionsOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NeonProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, 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 projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, 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 NeonProjectData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonProjectData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonProjectResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName) { 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 GetConnectionUri(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectionUriAsync(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetNeonBranch(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonBranchAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonBranchCollection GetNeonBranches() { throw null; } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.NeonPostgres.Mocking @@ -68,7 +182,9 @@ namespace Azure.ResourceManager.NeonPostgres.Mocking public partial class MockableNeonPostgresArmClient : Azure.ResourceManager.ArmResource { protected MockableNeonPostgresArmClient() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonBranchResource GetNeonBranchResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonProjectResource GetNeonProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableNeonPostgresResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -76,6 +192,8 @@ protected MockableNeonPostgresResourceGroupResource() { } public virtual Azure.Response GetNeonOrganization(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNeonOrganizationAsync(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations() { throw null; } + public virtual Azure.Response GetPostgresVersionsOrganization(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableNeonPostgresSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -88,8 +206,81 @@ namespace Azure.ResourceManager.NeonPostgres.Models { public static partial class ArmNeonPostgresModelFactory { + public static Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties ConnectionUriProperties(string projectId = null, string branchId = null, string databaseName = null, string roleName = null, string endpointId = null, bool? isPooled = default(bool?), string connectionStringUri = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonBranchData NeonBranchData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties NeonBranchProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string parentId = null, string roleName = null, string databaseName = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonCompute NeonCompute(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties NeonComputeProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string region = null, int? cpuCores = default(int?), int? memory = default(int?), string status = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonDatabase NeonDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties NeonDatabaseProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, string ownerName = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonEndpoint NeonEndpoint(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties NeonEndpointProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string branchId = null, Azure.ResourceManager.NeonPostgres.Models.EndpointType? endpointType = default(Azure.ResourceManager.NeonPostgres.Models.EndpointType?)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationData NeonOrganizationData(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.NeonPostgres.Models.NeonOrganizationProperties properties = null) { throw null; } - public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties projectProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonProjectData NeonProjectData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties NeonProjectProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attribute = null, string regionId = null, long? storage = default(long?), int? postgresVersion = default(int?), int? historyRetention = default(int?), Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings defaultEndpointSettings = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties branch = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonRole NeonRole(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties NeonRoleProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, System.Collections.Generic.IEnumerable permissions = null, bool? isSuperUser = default(bool?)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult PgVersionsResult(System.Collections.Generic.IEnumerable versions = null) { throw null; } + } + public partial class Attributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Attributes(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectionUriProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUriProperties() { } + public string BranchId { get { throw null; } set { } } + public string ConnectionStringUri { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public string EndpointId { get { throw null; } set { } } + public bool? IsPooled { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public string RoleName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DefaultEndpointSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu) { } + public float AutoscalingLimitMaxCu { get { throw null; } set { } } + public float AutoscalingLimitMinCu { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 EndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EndpointType(string value) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadOnly { get { throw null; } } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.NeonPostgres.Models.EndpointType 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.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.NeonPostgres.Models.EndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable @@ -111,6 +302,28 @@ public static partial class ArmNeonPostgresModelFactory public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonBranchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonBranchProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string CreatedAt { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ParentId { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonCompanyDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonCompanyDetails() { } @@ -127,6 +340,93 @@ 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 NeonCompute : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonCompute() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonCompute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonCompute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonComputeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonComputeProperties() { } + public System.Collections.Generic.IReadOnlyList Attributes { get { throw null; } } + public int? CpuCores { get { throw null; } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } } + public int? Memory { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string Region { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabase : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonDatabase() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonDatabaseProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string OwnerName { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonEndpoint : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonEndpoint() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonEndpointProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.EndpointType? EndpointType { get { throw null; } set { } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonMarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonMarketplaceDetails(Azure.ResourceManager.NeonPostgres.Models.NeonOfferDetails offerDetails) { } @@ -162,6 +462,7 @@ public NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.Neon public Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails CompanyDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails MarketplaceDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties PartnerOrganizationProperties { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties ProjectProperties { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails UserDetails { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -171,6 +472,30 @@ 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 NeonProjectProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonProjectProperties() { } + public System.Collections.Generic.IList Attribute { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Branch { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings DefaultEndpointSettings { get { throw null; } set { } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public int? HistoryRetention { get { throw null; } set { } } + public int? PostgresVersion { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RegionId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public long? Storage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 NeonResourceProvisioningState : System.IEquatable { @@ -190,6 +515,35 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState left, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonRole : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonRole() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRole System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRole System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonRoleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonRoleProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public bool? IsSuperUser { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonSingleSignOnProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonSingleSignOnProperties() { } @@ -251,4 +605,26 @@ 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 PgVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PgVersion() { } + public int? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PgVersionsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PgVersionsResult() { } + public System.Collections.Generic.IReadOnlyList Versions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs index f6e35086e51c..13ad025f8861 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs @@ -1,5 +1,60 @@ namespace Azure.ResourceManager.NeonPostgres { + public partial class NeonBranchCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonBranchCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string branchName, 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 branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string branchName, 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 NeonBranchData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonBranchData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonBranchResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonBranchResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonBranchData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetComputes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetComputesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetEndpoints(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetEndpointsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetNeonDatabases(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetNeonDatabasesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetNeonRoles(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetNeonRolesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonBranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonBranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NeonOrganizationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NeonOrganizationCollection() { } @@ -41,6 +96,9 @@ protected NeonOrganizationResource() { } 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 GetNeonProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonProjectCollection GetNeonProjects() { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -55,12 +113,68 @@ protected NeonOrganizationResource() { } } public static partial class NeonPostgresExtensions { + public static Azure.ResourceManager.NeonPostgres.NeonBranchResource GetNeonBranchResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetNeonOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetNeonOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetNeonOrganizations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNeonOrganizationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonProjectResource GetNeonProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetPostgresVersionsOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NeonProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, 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 projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, 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 NeonProjectData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonProjectData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonProjectResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName) { 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 GetConnectionUri(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectionUriAsync(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetNeonBranch(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonBranchAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonBranchCollection GetNeonBranches() { throw null; } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.NeonPostgres.Mocking @@ -68,7 +182,9 @@ namespace Azure.ResourceManager.NeonPostgres.Mocking public partial class MockableNeonPostgresArmClient : Azure.ResourceManager.ArmResource { protected MockableNeonPostgresArmClient() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonBranchResource GetNeonBranchResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonProjectResource GetNeonProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableNeonPostgresResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -76,6 +192,8 @@ protected MockableNeonPostgresResourceGroupResource() { } public virtual Azure.Response GetNeonOrganization(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNeonOrganizationAsync(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations() { throw null; } + public virtual Azure.Response GetPostgresVersionsOrganization(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableNeonPostgresSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -88,8 +206,81 @@ namespace Azure.ResourceManager.NeonPostgres.Models { public static partial class ArmNeonPostgresModelFactory { + public static Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties ConnectionUriProperties(string projectId = null, string branchId = null, string databaseName = null, string roleName = null, string endpointId = null, bool? isPooled = default(bool?), string connectionStringUri = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonBranchData NeonBranchData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties NeonBranchProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string parentId = null, string roleName = null, string databaseName = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonCompute NeonCompute(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties NeonComputeProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string region = null, int? cpuCores = default(int?), int? memory = default(int?), string status = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonDatabase NeonDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties NeonDatabaseProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, string ownerName = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonEndpoint NeonEndpoint(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties NeonEndpointProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string branchId = null, Azure.ResourceManager.NeonPostgres.Models.EndpointType? endpointType = default(Azure.ResourceManager.NeonPostgres.Models.EndpointType?)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationData NeonOrganizationData(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.NeonPostgres.Models.NeonOrganizationProperties properties = null) { throw null; } - public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties projectProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonProjectData NeonProjectData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties NeonProjectProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attribute = null, string regionId = null, long? storage = default(long?), int? postgresVersion = default(int?), int? historyRetention = default(int?), Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings defaultEndpointSettings = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties branch = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonRole NeonRole(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties NeonRoleProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, System.Collections.Generic.IEnumerable permissions = null, bool? isSuperUser = default(bool?)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult PgVersionsResult(System.Collections.Generic.IEnumerable versions = null) { throw null; } + } + public partial class Attributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Attributes(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectionUriProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUriProperties() { } + public string BranchId { get { throw null; } set { } } + public string ConnectionStringUri { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public string EndpointId { get { throw null; } set { } } + public bool? IsPooled { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public string RoleName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DefaultEndpointSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu) { } + public float AutoscalingLimitMaxCu { get { throw null; } set { } } + public float AutoscalingLimitMinCu { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 EndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EndpointType(string value) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadOnly { get { throw null; } } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.NeonPostgres.Models.EndpointType 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.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.NeonPostgres.Models.EndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable @@ -111,6 +302,28 @@ public static partial class ArmNeonPostgresModelFactory public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonBranchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonBranchProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string CreatedAt { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ParentId { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonCompanyDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonCompanyDetails() { } @@ -127,6 +340,93 @@ 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 NeonCompute : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonCompute() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonCompute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonCompute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonComputeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonComputeProperties() { } + public System.Collections.Generic.IReadOnlyList Attributes { get { throw null; } } + public int? CpuCores { get { throw null; } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } } + public int? Memory { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string Region { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabase : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonDatabase() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonDatabaseProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string OwnerName { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonEndpoint : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonEndpoint() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonEndpointProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.EndpointType? EndpointType { get { throw null; } set { } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonMarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonMarketplaceDetails(Azure.ResourceManager.NeonPostgres.Models.NeonOfferDetails offerDetails) { } @@ -162,6 +462,7 @@ public NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.Neon public Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails CompanyDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails MarketplaceDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties PartnerOrganizationProperties { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties ProjectProperties { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails UserDetails { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -171,6 +472,30 @@ 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 NeonProjectProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonProjectProperties() { } + public System.Collections.Generic.IList Attribute { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Branch { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings DefaultEndpointSettings { get { throw null; } set { } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public int? HistoryRetention { get { throw null; } set { } } + public int? PostgresVersion { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RegionId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public long? Storage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 NeonResourceProvisioningState : System.IEquatable { @@ -190,6 +515,35 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState left, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonRole : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NeonRole() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRole System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRole System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonRoleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonRoleProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public bool? IsSuperUser { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonSingleSignOnProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonSingleSignOnProperties() { } @@ -251,4 +605,26 @@ 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 PgVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PgVersion() { } + public int? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PgVersionsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PgVersionsResult() { } + public System.Collections.Generic.IReadOnlyList Versions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs index 3c3215cb7d69..2ac918ae190c 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs @@ -45,9 +45,10 @@ public static NeonOrganizationData NeonOrganizationData(ResourceIdentifier id = /// Details of the user. /// Details of the company. /// Provisioning state of the resource. - /// Organization properties. + /// Neon Organization properties. + /// Neon Project Properties. /// A new instance for mocking. - public static NeonOrganizationProperties NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails = null, NeonUserDetails userDetails = null, NeonCompanyDetails companyDetails = null, NeonResourceProvisioningState? provisioningState = null, PartnerOrganizationProperties partnerOrganizationProperties = null) + public static NeonOrganizationProperties NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails = null, NeonUserDetails userDetails = null, NeonCompanyDetails companyDetails = null, NeonResourceProvisioningState? provisioningState = null, PartnerOrganizationProperties partnerOrganizationProperties = null, NeonProjectProperties projectProperties = null) { return new NeonOrganizationProperties( marketplaceDetails, @@ -55,6 +56,330 @@ public static NeonOrganizationProperties NeonOrganizationProperties(NeonMarketpl companyDetails, provisioningState, partnerOrganizationProperties, + projectProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the project is created. + /// Data Storage bytes per hour for the project. + /// Postgres version for the project. + /// The retention period for project history in seconds. + /// Default endpoint settings for the project. + /// The Branch properties of the project. This is optional. + /// Roles associated with the project. + /// Neon Databases associated with the project. + /// Endpoints associated with the project. + /// A new instance for mocking. + public static NeonProjectProperties NeonProjectProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attribute = null, string regionId = null, long? storage = null, int? postgresVersion = null, int? historyRetention = null, DefaultEndpointSettings defaultEndpointSettings = null, NeonBranchProperties branch = null, IEnumerable roles = null, IEnumerable databases = null, IEnumerable endpoints = null) + { + attribute ??= new List(); + roles ??= new List(); + databases ??= new List(); + endpoints ??= new List(); + + return new NeonProjectProperties( + entityId, + entityName, + createdAt, + provisioningState, + attribute?.ToList(), + regionId, + storage, + postgresVersion, + historyRetention, + defaultEndpointSettings, + branch, + roles?.ToList(), + databases?.ToList(), + endpoints?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this branch belongs to. + /// The ID of the parent branch. + /// Role name associated with the branch. + /// Database name associated with the branch. + /// Roles associated with the branch. + /// Neon Databases associated with the branch. + /// Endpoints associated with the branch. + /// A new instance for mocking. + public static NeonBranchProperties NeonBranchProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string projectId = null, string parentId = null, string roleName = null, string databaseName = null, IEnumerable roles = null, IEnumerable databases = null, IEnumerable endpoints = null) + { + attributes ??= new List(); + roles ??= new List(); + databases ??= new List(); + endpoints ??= new List(); + + return new NeonBranchProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + projectId, + parentId, + roleName, + databaseName, + roles?.ToList(), + databases?.ToList(), + endpoints?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this role belongs to. + /// Permissions assigned to the role. + /// Indicates whether the role has superuser privileges. + /// A new instance for mocking. + public static NeonRoleProperties NeonRoleProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string branchId = null, IEnumerable permissions = null, bool? isSuperUser = null) + { + attributes ??= new List(); + permissions ??= new List(); + + return new NeonRoleProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + branchId, + permissions?.ToList(), + isSuperUser, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this database belongs to. + /// The name of the role that owns the database. + /// A new instance for mocking. + public static NeonDatabaseProperties NeonDatabaseProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string branchId = null, string ownerName = null) + { + attributes ??= new List(); + + return new NeonDatabaseProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + branchId, + ownerName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this endpoint belongs to. + /// The ID of the branch this endpoint belongs to. + /// The type of the endpoint. + /// A new instance for mocking. + public static NeonEndpointProperties NeonEndpointProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string projectId = null, string branchId = null, EndpointType? endpointType = null) + { + attributes ??= new List(); + + return new NeonEndpointProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + projectId, + branchId, + endpointType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// List of PostgreSQL versions. + /// A new instance for mocking. + public static PgVersionsResult PgVersionsResult(IEnumerable versions = null) + { + versions ??= new List(); + + return new PgVersionsResult(versions?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonProjectData NeonProjectData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonProjectProperties properties = null) + { + return new NeonProjectData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Project Id associated with this connection. + /// Branch Id associated with this connection. + /// Database name associated with this connection. + /// The role name used for authentication. + /// the endpoint Id with this connection. + /// Indicates if the connection is pooled. + /// connection uri returned for the database. + /// A new instance for mocking. + public static ConnectionUriProperties ConnectionUriProperties(string projectId = null, string branchId = null, string databaseName = null, string roleName = null, string endpointId = null, bool? isPooled = null, string connectionStringUri = null) + { + return new ConnectionUriProperties( + projectId, + branchId, + databaseName, + roleName, + endpointId, + isPooled, + connectionStringUri, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonBranchData NeonBranchData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonBranchProperties properties = null) + { + return new NeonBranchData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonCompute NeonCompute(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonComputeProperties properties = null) + { + return new NeonCompute( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the compute instance is located. + /// Number of allocated CPU cores. + /// Memory allocated in GB. + /// Current status of the compute instance. + /// A new instance for mocking. + public static NeonComputeProperties NeonComputeProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string region = null, int? cpuCores = null, int? memory = null, string status = null) + { + attributes ??= new List(); + + return new NeonComputeProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + region, + cpuCores, + memory, + status, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonDatabase NeonDatabase(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonDatabaseProperties properties = null) + { + return new NeonDatabase( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonRole NeonRole(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonRoleProperties properties = null) + { + return new NeonRole( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonEndpoint NeonEndpoint(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonEndpointProperties properties = null) + { + return new NeonEndpoint( + id, + name, + resourceType, + systemData, + properties, serializedAdditionalRawData: null); } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs index 5a92c8fc6b3a..41b58d8089a2 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs @@ -45,5 +45,29 @@ public virtual NeonOrganizationResource GetNeonOrganizationResource(ResourceIden NeonOrganizationResource.ValidateResourceId(id); return new NeonOrganizationResource(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 NeonProjectResource GetNeonProjectResource(ResourceIdentifier id) + { + NeonProjectResource.ValidateResourceId(id); + return new NeonProjectResource(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 NeonBranchResource GetNeonBranchResource(ResourceIdentifier id) + { + NeonBranchResource.ValidateResourceId(id); + return new NeonBranchResource(Client, id); + } } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs index 54b0de3692f3..8c33caacd526 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs @@ -9,12 +9,17 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.NeonPostgres.Models; namespace Azure.ResourceManager.NeonPostgres.Mocking { /// A class to add extension methods to ResourceGroupResource. public partial class MockableNeonPostgresResourceGroupResource : ArmResource { + private ClientDiagnostics _neonOrganizationOrganizationsClientDiagnostics; + private OrganizationsRestOperations _neonOrganizationOrganizationsRestClient; + /// Initializes a new instance of the class for mocking. protected MockableNeonPostgresResourceGroupResource() { @@ -27,6 +32,9 @@ internal MockableNeonPostgresResourceGroupResource(ArmClient client, ResourceIde { } + private ClientDiagnostics NeonOrganizationOrganizationsClientDiagnostics => _neonOrganizationOrganizationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", NeonOrganizationResource.ResourceType.Namespace, Diagnostics); + private OrganizationsRestOperations NeonOrganizationOrganizationsRestClient => _neonOrganizationOrganizationsRestClient ??= new OrganizationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NeonOrganizationResource.ResourceType)); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); @@ -53,7 +61,7 @@ public virtual NeonOrganizationCollection GetNeonOrganizations() /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -84,7 +92,7 @@ public virtual async Task> GetNeonOrganizatio /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -101,5 +109,83 @@ public virtual Response GetNeonOrganization(string org { return GetNeonOrganizations().Get(organizationName, cancellationToken); } + + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + public virtual async Task> GetPostgresVersionsOrganizationAsync(PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + using var scope = NeonOrganizationOrganizationsClientDiagnostics.CreateScope("MockableNeonPostgresResourceGroupResource.GetPostgresVersionsOrganization"); + scope.Start(); + try + { + var response = await NeonOrganizationOrganizationsRestClient.GetPostgresVersionsAsync(Id.SubscriptionId, Id.ResourceGroupName, pgVersion, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + public virtual Response GetPostgresVersionsOrganization(PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + using var scope = NeonOrganizationOrganizationsClientDiagnostics.CreateScope("MockableNeonPostgresResourceGroupResource.GetPostgresVersionsOrganization"); + scope.Start(); + try + { + var response = NeonOrganizationOrganizationsRestClient.GetPostgresVersions(Id.SubscriptionId, Id.ResourceGroupName, pgVersion, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs index abc57a2d6f31..71ebd2216522 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetNeonOrganizationsAsync /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs index 9037e7c839eb..674d0c9338a0 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.ResourceManager.NeonPostgres.Mocking; +using Azure.ResourceManager.NeonPostgres.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.NeonPostgres @@ -51,6 +52,44 @@ public static NeonOrganizationResource GetNeonOrganizationResource(this ArmClien return GetMockableNeonPostgresArmClient(client).GetNeonOrganizationResource(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 NeonProjectResource GetNeonProjectResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetNeonProjectResource(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 NeonBranchResource GetNeonBranchResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetNeonBranchResource(id); + } + /// /// Gets a collection of NeonOrganizationResources in the ResourceGroupResource. /// @@ -81,7 +120,7 @@ public static NeonOrganizationCollection GetNeonOrganizations(this ResourceGroup /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -119,7 +158,7 @@ public static async Task> GetNeonOrganization /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -144,6 +183,78 @@ public static Response GetNeonOrganization(this Resour return GetMockableNeonPostgresResourceGroupResource(resourceGroupResource).GetNeonOrganization(organizationName, cancellationToken); } + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// is null. + public static async Task> GetPostgresVersionsOrganizationAsync(this ResourceGroupResource resourceGroupResource, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableNeonPostgresResourceGroupResource(resourceGroupResource).GetPostgresVersionsOrganizationAsync(pgVersion, cancellationToken).ConfigureAwait(false); + } + + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// is null. + public static Response GetPostgresVersionsOrganization(this ResourceGroupResource resourceGroupResource, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableNeonPostgresResourceGroupResource(resourceGroupResource).GetPostgresVersionsOrganization(pgVersion, cancellationToken); + } + /// /// List OrganizationResource resources by subscription ID /// @@ -157,7 +268,7 @@ public static Response GetNeonOrganization(this Resour /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -193,7 +304,7 @@ public static AsyncPageable GetNeonOrganizationsAsync( /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonBranchOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonBranchOperationSource.cs new file mode 100644 index 000000000000..0be24576698f --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonBranchOperationSource.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.NeonPostgres +{ + internal class NeonBranchOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NeonBranchOperationSource(ArmClient client) + { + _client = client; + } + + NeonBranchResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new NeonBranchResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new NeonBranchResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonProjectOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonProjectOperationSource.cs new file mode 100644 index 000000000000..42e558a59921 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonProjectOperationSource.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.NeonPostgres +{ + internal class NeonProjectOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NeonProjectOperationSource(ArmClient client) + { + _client = client; + } + + NeonProjectResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new NeonProjectResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new NeonProjectResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.Serialization.cs new file mode 100644 index 000000000000..49b17d0dc60b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.Serialization.cs @@ -0,0 +1,134 @@ +// 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.NeonPostgres.Models +{ + public partial class Attributes : 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(Attributes)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Attributes 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(Attributes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAttributes(document.RootElement, options); + } + + internal static Attributes DeserializeAttributes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Attributes(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Attributes)} does not support writing '{options.Format}' format."); + } + } + + Attributes 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 DeserializeAttributes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Attributes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.cs new file mode 100644 index 000000000000..31082f4bd0ba --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.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.NeonPostgres.Models +{ + /// Additional attributes specific to Neon Resources. + public partial class Attributes + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the attribute. + /// Value of the attribute. + /// or is null. + public Attributes(string name, string value) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(value, nameof(value)); + + Name = name; + Value = value; + } + + /// Initializes a new instance of . + /// Name of the attribute. + /// Value of the attribute. + /// Keeps track of any properties unknown to the library. + internal Attributes(string name, string value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Attributes() + { + } + + /// Name of the attribute. + public string Name { get; set; } + /// Value of the attribute. + public string Value { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.Serialization.cs new file mode 100644 index 000000000000..dad0f179ba85 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.NeonPostgres.Models +{ + internal partial class BranchListResult : 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(BranchListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BranchListResult 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(BranchListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBranchListResult(document.RootElement, options); + } + + internal static BranchListResult DeserializeBranchListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonBranchData.DeserializeNeonBranchData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BranchListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BranchListResult)} does not support writing '{options.Format}' format."); + } + } + + BranchListResult 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 DeserializeBranchListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BranchListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.cs new file mode 100644 index 000000000000..5acbfe82d061 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The response of a Branch list operation. + internal partial class BranchListResult + { + /// + /// 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 Branch items on this page. + /// is null. + internal BranchListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Branch items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BranchListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BranchListResult() + { + } + + /// The Branch items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.Serialization.cs new file mode 100644 index 000000000000..c23b273e954b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.NeonPostgres.Models +{ + internal partial class ComputeListResult : 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(ComputeListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ComputeListResult 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(ComputeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeListResult(document.RootElement, options); + } + + internal static ComputeListResult DeserializeComputeListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonCompute.DeserializeNeonCompute(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeListResult)} does not support writing '{options.Format}' format."); + } + } + + ComputeListResult 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 DeserializeComputeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.cs new file mode 100644 index 000000000000..2ba1a93ef7a9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The response of a Compute list operation. + internal partial class ComputeListResult + { + /// + /// 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 Compute items on this page. + /// is null. + internal ComputeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Compute items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ComputeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeListResult() + { + } + + /// The Compute items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs new file mode 100644 index 000000000000..c4623a1eb444 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs @@ -0,0 +1,207 @@ +// 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.NeonPostgres.Models +{ + public partial class ConnectionUriProperties : 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(ConnectionUriProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProjectId)) + { + writer.WritePropertyName("projectId"u8); + writer.WriteStringValue(ProjectId); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(EndpointId)) + { + writer.WritePropertyName("endpointId"u8); + writer.WriteStringValue(EndpointId); + } + if (Optional.IsDefined(IsPooled)) + { + writer.WritePropertyName("isPooled"u8); + writer.WriteBooleanValue(IsPooled.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionStringUri)) + { + writer.WritePropertyName("connectionStringUri"u8); + writer.WriteStringValue(ConnectionStringUri); + } + 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 + } + } + } + + ConnectionUriProperties 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(ConnectionUriProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionUriProperties(document.RootElement, options); + } + + internal static ConnectionUriProperties DeserializeConnectionUriProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectId = default; + string branchId = default; + string databaseName = default; + string roleName = default; + string endpointId = default; + bool? isPooled = default; + string connectionStringUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectId"u8)) + { + projectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("roleName"u8)) + { + roleName = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointId"u8)) + { + endpointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPooled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPooled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("connectionStringUri"u8)) + { + connectionStringUri = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionUriProperties( + projectId, + branchId, + databaseName, + roleName, + endpointId, + isPooled, + connectionStringUri, + 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(ConnectionUriProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectionUriProperties 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 DeserializeConnectionUriProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionUriProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.cs new file mode 100644 index 000000000000..3de24453b5ac --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Connection uri parameters for the associated database. + public partial class ConnectionUriProperties + { + /// + /// 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 ConnectionUriProperties() + { + } + + /// Initializes a new instance of . + /// Project Id associated with this connection. + /// Branch Id associated with this connection. + /// Database name associated with this connection. + /// The role name used for authentication. + /// the endpoint Id with this connection. + /// Indicates if the connection is pooled. + /// connection uri returned for the database. + /// Keeps track of any properties unknown to the library. + internal ConnectionUriProperties(string projectId, string branchId, string databaseName, string roleName, string endpointId, bool? isPooled, string connectionStringUri, IDictionary serializedAdditionalRawData) + { + ProjectId = projectId; + BranchId = branchId; + DatabaseName = databaseName; + RoleName = roleName; + EndpointId = endpointId; + IsPooled = isPooled; + ConnectionStringUri = connectionStringUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Project Id associated with this connection. + public string ProjectId { get; set; } + /// Branch Id associated with this connection. + public string BranchId { get; set; } + /// Database name associated with this connection. + public string DatabaseName { get; set; } + /// The role name used for authentication. + public string RoleName { get; set; } + /// the endpoint Id with this connection. + public string EndpointId { get; set; } + /// Indicates if the connection is pooled. + public bool? IsPooled { get; set; } + /// connection uri returned for the database. + public string ConnectionStringUri { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.Serialization.cs new file mode 100644 index 000000000000..8002a758b0a9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.Serialization.cs @@ -0,0 +1,134 @@ +// 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.NeonPostgres.Models +{ + public partial class DefaultEndpointSettings : 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(DefaultEndpointSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("autoscalingLimitMinCu"u8); + writer.WriteNumberValue(AutoscalingLimitMinCu); + writer.WritePropertyName("autoscalingLimitMaxCu"u8); + writer.WriteNumberValue(AutoscalingLimitMaxCu); + 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 + } + } + } + + DefaultEndpointSettings 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(DefaultEndpointSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDefaultEndpointSettings(document.RootElement, options); + } + + internal static DefaultEndpointSettings DeserializeDefaultEndpointSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float autoscalingLimitMinCu = default; + float autoscalingLimitMaxCu = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("autoscalingLimitMinCu"u8)) + { + autoscalingLimitMinCu = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("autoscalingLimitMaxCu"u8)) + { + autoscalingLimitMaxCu = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DefaultEndpointSettings(autoscalingLimitMinCu, autoscalingLimitMaxCu, 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(DefaultEndpointSettings)} does not support writing '{options.Format}' format."); + } + } + + DefaultEndpointSettings 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 DeserializeDefaultEndpointSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DefaultEndpointSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.cs new file mode 100644 index 000000000000..ea7accff0b69 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.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.NeonPostgres.Models +{ + /// Default Endpoint Settings for the project. + public partial class DefaultEndpointSettings + { + /// + /// 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 . + /// Minimum compute units for autoscaling. + /// Maximum compute units for autoscaling. + public DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu) + { + AutoscalingLimitMinCu = autoscalingLimitMinCu; + AutoscalingLimitMaxCu = autoscalingLimitMaxCu; + } + + /// Initializes a new instance of . + /// Minimum compute units for autoscaling. + /// Maximum compute units for autoscaling. + /// Keeps track of any properties unknown to the library. + internal DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu, IDictionary serializedAdditionalRawData) + { + AutoscalingLimitMinCu = autoscalingLimitMinCu; + AutoscalingLimitMaxCu = autoscalingLimitMaxCu; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DefaultEndpointSettings() + { + } + + /// Minimum compute units for autoscaling. + public float AutoscalingLimitMinCu { get; set; } + /// Maximum compute units for autoscaling. + public float AutoscalingLimitMaxCu { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.Serialization.cs new file mode 100644 index 000000000000..3a9f3ef278dc --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.NeonPostgres.Models +{ + internal partial class EndpointListResult : 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(EndpointListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EndpointListResult 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(EndpointListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointListResult(document.RootElement, options); + } + + internal static EndpointListResult DeserializeEndpointListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonEndpoint.DeserializeNeonEndpoint(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointListResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointListResult 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 DeserializeEndpointListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.cs new file mode 100644 index 000000000000..b759e7ac8e62 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The response of a Endpoint list operation. + internal partial class EndpointListResult + { + /// + /// 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 Endpoint items on this page. + /// is null. + internal EndpointListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Endpoint items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EndpointListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointListResult() + { + } + + /// The Endpoint items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.cs new file mode 100644 index 000000000000..eeffb601434b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.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.NeonPostgres.Models +{ + /// The compute endpoint type. Either read_write or read_only. + public readonly partial struct EndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadOnlyValue = "read_only"; + private const string ReadWriteValue = "read_write"; + + /// ReadOnly compute endpoint type. + public static EndpointType ReadOnly { get; } = new EndpointType(ReadOnlyValue); + /// ReadWrite compute endpoint type. + public static EndpointType ReadWrite { get; } = new EndpointType(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(EndpointType left, EndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EndpointType left, EndpointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EndpointType(string value) => new EndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EndpointType other && Equals(other); + /// + public bool Equals(EndpointType 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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs new file mode 100644 index 000000000000..2fd2341179e2 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs @@ -0,0 +1,323 @@ +// 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.NeonPostgres.Models +{ + public partial class NeonBranchProperties : 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(NeonBranchProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProjectId)) + { + writer.WritePropertyName("projectId"u8); + writer.WriteStringValue(ProjectId); + } + if (Optional.IsDefined(ParentId)) + { + writer.WritePropertyName("parentId"u8); + writer.WriteStringValue(ParentId); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"u8); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Endpoints)) + { + writer.WritePropertyName("endpoints"u8); + writer.WriteStartArray(); + foreach (var item in Endpoints) + { + 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 + } + } + } + + NeonBranchProperties 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(NeonBranchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonBranchProperties(document.RootElement, options); + } + + internal static NeonBranchProperties DeserializeNeonBranchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string projectId = default; + string parentId = default; + string roleName = default; + string databaseName = default; + IList roles = default; + IList databases = default; + IList endpoints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("projectId"u8)) + { + projectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("parentId"u8)) + { + parentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("roleName"u8)) + { + roleName = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonRoleProperties.DeserializeNeonRoleProperties(item, options)); + } + roles = array; + continue; + } + if (property.NameEquals("databases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonDatabaseProperties.DeserializeNeonDatabaseProperties(item, options)); + } + databases = array; + continue; + } + if (property.NameEquals("endpoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonEndpointProperties.DeserializeNeonEndpointProperties(item, options)); + } + endpoints = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonBranchProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + projectId, + parentId, + roleName, + databaseName, + roles ?? new ChangeTrackingList(), + databases ?? new ChangeTrackingList(), + endpoints ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonBranchProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonBranchProperties 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 DeserializeNeonBranchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonBranchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs new file mode 100644 index 000000000000..f67b0839be88 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Branch. + public partial class NeonBranchProperties + { + /// + /// 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 NeonBranchProperties() + { + Attributes = new ChangeTrackingList(); + Roles = new ChangeTrackingList(); + Databases = new ChangeTrackingList(); + Endpoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this branch belongs to. + /// The ID of the parent branch. + /// Role name associated with the branch. + /// Database name associated with the branch. + /// Roles associated with the branch. + /// Neon Databases associated with the branch. + /// Endpoints associated with the branch. + /// Keeps track of any properties unknown to the library. + internal NeonBranchProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string projectId, string parentId, string roleName, string databaseName, IList roles, IList databases, IList endpoints, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + ProjectId = projectId; + ParentId = parentId; + RoleName = roleName; + DatabaseName = databaseName; + Roles = roles; + Databases = databases; + Endpoints = endpoints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the project this branch belongs to. + public string ProjectId { get; set; } + /// The ID of the parent branch. + public string ParentId { get; set; } + /// Role name associated with the branch. + public string RoleName { get; set; } + /// Database name associated with the branch. + public string DatabaseName { get; set; } + /// Roles associated with the branch. + public IList Roles { get; } + /// Neon Databases associated with the branch. + public IList Databases { get; } + /// Endpoints associated with the branch. + public IList Endpoints { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonCompute.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonCompute.Serialization.cs new file mode 100644 index 000000000000..2c628d0c1dbc --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonCompute.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class NeonCompute : 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(NeonCompute)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonCompute 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(NeonCompute)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonCompute(document.RootElement, options); + } + + internal static NeonCompute DeserializeNeonCompute(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonComputeProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NeonComputeProperties.DeserializeNeonComputeProperties(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 NeonCompute( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonCompute)} does not support writing '{options.Format}' format."); + } + } + + NeonCompute 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 DeserializeNeonCompute(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonCompute)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonCompute.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonCompute.cs new file mode 100644 index 000000000000..8c5a18df1ac4 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonCompute.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The Compute resource type. + public partial class NeonCompute : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NeonCompute() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal NeonCompute(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonComputeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonComputeProperties Properties { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs new file mode 100644 index 000000000000..f71aeade03f3 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs @@ -0,0 +1,253 @@ +// 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.NeonPostgres.Models +{ + public partial class NeonComputeProperties : 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(NeonComputeProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Region)) + { + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + } + if (Optional.IsDefined(CpuCores)) + { + writer.WritePropertyName("cpuCores"u8); + writer.WriteNumberValue(CpuCores.Value); + } + if (Optional.IsDefined(Memory)) + { + writer.WritePropertyName("memory"u8); + writer.WriteNumberValue(Memory.Value); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeonComputeProperties 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(NeonComputeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonComputeProperties(document.RootElement, options); + } + + internal static NeonComputeProperties DeserializeNeonComputeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IReadOnlyList attributes = default; + string region = default; + int? cpuCores = default; + int? memory = default; + string status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memory = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonComputeProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + region, + cpuCores, + memory, + status, + 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(NeonComputeProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonComputeProperties 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 DeserializeNeonComputeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonComputeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.cs new file mode 100644 index 000000000000..9230e4975998 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.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; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Compute. + public partial class NeonComputeProperties + { + /// + /// 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 NeonComputeProperties() + { + Attributes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the compute instance is located. + /// Number of allocated CPU cores. + /// Memory allocated in GB. + /// Current status of the compute instance. + /// Keeps track of any properties unknown to the library. + internal NeonComputeProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IReadOnlyList attributes, string region, int? cpuCores, int? memory, string status, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + Region = region; + CpuCores = cpuCores; + Memory = memory; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IReadOnlyList Attributes { get; } + /// Region where the compute instance is located. + public string Region { get; } + /// Number of allocated CPU cores. + public int? CpuCores { get; } + /// Memory allocated in GB. + public int? Memory { get; } + /// Current status of the compute instance. + public string Status { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabase.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabase.Serialization.cs new file mode 100644 index 000000000000..4650fd119dce --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabase.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class NeonDatabase : 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(NeonDatabase)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonDatabase 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(NeonDatabase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonDatabase(document.RootElement, options); + } + + internal static NeonDatabase DeserializeNeonDatabase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonDatabaseProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NeonDatabaseProperties.DeserializeNeonDatabaseProperties(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 NeonDatabase( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonDatabase)} does not support writing '{options.Format}' format."); + } + } + + NeonDatabase 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 DeserializeNeonDatabase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonDatabase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabase.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabase.cs new file mode 100644 index 000000000000..9bc59b7cbe80 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabase.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The Neon Database resource type. + public partial class NeonDatabase : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NeonDatabase() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal NeonDatabase(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonDatabaseProperties Properties { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.Serialization.cs new file mode 100644 index 000000000000..09f076094a04 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.NeonPostgres.Models +{ + internal partial class NeonDatabaseListResult : 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(NeonDatabaseListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeonDatabaseListResult 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(NeonDatabaseListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonDatabaseListResult(document.RootElement, options); + } + + internal static NeonDatabaseListResult DeserializeNeonDatabaseListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonDatabase.DeserializeNeonDatabase(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonDatabaseListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonDatabaseListResult)} does not support writing '{options.Format}' format."); + } + } + + NeonDatabaseListResult 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 DeserializeNeonDatabaseListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonDatabaseListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.cs new file mode 100644 index 000000000000..7d5b9aa96b63 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The response of a NeonDatabase list operation. + internal partial class NeonDatabaseListResult + { + /// + /// 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 NeonDatabase items on this page. + /// is null. + internal NeonDatabaseListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NeonDatabase items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NeonDatabaseListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NeonDatabaseListResult() + { + } + + /// The NeonDatabase items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..9a9fb45a241e --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.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.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class NeonDatabaseProperties : 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(NeonDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsDefined(OwnerName)) + { + writer.WritePropertyName("ownerName"u8); + writer.WriteStringValue(OwnerName); + } + 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 + } + } + } + + NeonDatabaseProperties 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(NeonDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonDatabaseProperties(document.RootElement, options); + } + + internal static NeonDatabaseProperties DeserializeNeonDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string branchId = default; + string ownerName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerName"u8)) + { + ownerName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonDatabaseProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + branchId, + ownerName, + 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(NeonDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonDatabaseProperties 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 DeserializeNeonDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.cs new file mode 100644 index 000000000000..c156854ffa74 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.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; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Databases. + public partial class NeonDatabaseProperties + { + /// + /// 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 NeonDatabaseProperties() + { + Attributes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this database belongs to. + /// The name of the role that owns the database. + /// Keeps track of any properties unknown to the library. + internal NeonDatabaseProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string branchId, string ownerName, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + BranchId = branchId; + OwnerName = ownerName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the branch this database belongs to. + public string BranchId { get; set; } + /// The name of the role that owns the database. + public string OwnerName { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpoint.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpoint.Serialization.cs new file mode 100644 index 000000000000..fafd2814e40a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpoint.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class NeonEndpoint : 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(NeonEndpoint)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonEndpoint 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(NeonEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonEndpoint(document.RootElement, options); + } + + internal static NeonEndpoint DeserializeNeonEndpoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonEndpointProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NeonEndpointProperties.DeserializeNeonEndpointProperties(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 NeonEndpoint( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonEndpoint)} does not support writing '{options.Format}' format."); + } + } + + NeonEndpoint 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 DeserializeNeonEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpoint.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpoint.cs new file mode 100644 index 000000000000..830c97e1bc56 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpoint.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The Neon compute endpoint resource type. + public partial class NeonEndpoint : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NeonEndpoint() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal NeonEndpoint(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonEndpointProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonEndpointProperties Properties { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs new file mode 100644 index 000000000000..f721bdeedc0a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs @@ -0,0 +1,237 @@ +// 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.NeonPostgres.Models +{ + public partial class NeonEndpointProperties : 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(NeonEndpointProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProjectId)) + { + writer.WritePropertyName("projectId"u8); + writer.WriteStringValue(ProjectId); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsDefined(EndpointType)) + { + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.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 + } + } + } + + NeonEndpointProperties 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(NeonEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonEndpointProperties(document.RootElement, options); + } + + internal static NeonEndpointProperties DeserializeNeonEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string projectId = default; + string branchId = default; + EndpointType? endpointType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("projectId"u8)) + { + projectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonEndpointProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + projectId, + branchId, + endpointType, + 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(NeonEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonEndpointProperties 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 DeserializeNeonEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs new file mode 100644 index 000000000000..1578ee283939 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Endpoints. + public partial class NeonEndpointProperties + { + /// + /// 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 NeonEndpointProperties() + { + Attributes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this endpoint belongs to. + /// The ID of the branch this endpoint belongs to. + /// The type of the endpoint. + /// Keeps track of any properties unknown to the library. + internal NeonEndpointProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string projectId, string branchId, EndpointType? endpointType, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + ProjectId = projectId; + BranchId = branchId; + EndpointType = endpointType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the project this endpoint belongs to. + public string ProjectId { get; set; } + /// The ID of the branch this endpoint belongs to. + public string BranchId { get; set; } + /// The type of the endpoint. + public EndpointType? EndpointType { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs index a4fc8025f83f..5c3faddd851a 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs @@ -50,6 +50,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("partnerOrganizationProperties"u8); writer.WriteObjectValue(PartnerOrganizationProperties, options); } + if (Optional.IsDefined(ProjectProperties)) + { + writer.WritePropertyName("projectProperties"u8); + writer.WriteObjectValue(ProjectProperties, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -92,6 +97,7 @@ internal static NeonOrganizationProperties DeserializeNeonOrganizationProperties NeonCompanyDetails companyDetails = default; NeonResourceProvisioningState? provisioningState = default; PartnerOrganizationProperties partnerOrganizationProperties = default; + NeonProjectProperties projectProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -129,6 +135,15 @@ internal static NeonOrganizationProperties DeserializeNeonOrganizationProperties partnerOrganizationProperties = PartnerOrganizationProperties.DeserializePartnerOrganizationProperties(property.Value, options); continue; } + if (property.NameEquals("projectProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + projectProperties = NeonProjectProperties.DeserializeNeonProjectProperties(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -141,6 +156,7 @@ internal static NeonOrganizationProperties DeserializeNeonOrganizationProperties companyDetails, provisioningState, partnerOrganizationProperties, + projectProperties, serializedAdditionalRawData); } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs index 90a25e7a9c58..8ad6a24c39ef 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.NeonPostgres.Models { - /// Properties specific to Data Organization resource. + /// Properties specific to Neon Organization resource. public partial class NeonOrganizationProperties { /// @@ -66,15 +66,17 @@ public NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails, Neo /// Details of the user. /// Details of the company. /// Provisioning state of the resource. - /// Organization properties. + /// Neon Organization properties. + /// Neon Project Properties. /// Keeps track of any properties unknown to the library. - internal NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails, NeonUserDetails userDetails, NeonCompanyDetails companyDetails, NeonResourceProvisioningState? provisioningState, PartnerOrganizationProperties partnerOrganizationProperties, IDictionary serializedAdditionalRawData) + internal NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails, NeonUserDetails userDetails, NeonCompanyDetails companyDetails, NeonResourceProvisioningState? provisioningState, PartnerOrganizationProperties partnerOrganizationProperties, NeonProjectProperties projectProperties, IDictionary serializedAdditionalRawData) { MarketplaceDetails = marketplaceDetails; UserDetails = userDetails; CompanyDetails = companyDetails; ProvisioningState = provisioningState; PartnerOrganizationProperties = partnerOrganizationProperties; + ProjectProperties = projectProperties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,7 +93,9 @@ internal NeonOrganizationProperties() public NeonCompanyDetails CompanyDetails { get; set; } /// Provisioning state of the resource. public NeonResourceProvisioningState? ProvisioningState { get; } - /// Organization properties. + /// Neon Organization properties. public PartnerOrganizationProperties PartnerOrganizationProperties { get; set; } + /// Neon Project Properties. + public NeonProjectProperties ProjectProperties { get; set; } } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs new file mode 100644 index 000000000000..b70cb6b729a1 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs @@ -0,0 +1,367 @@ +// 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.NeonPostgres.Models +{ + public partial class NeonProjectProperties : 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(NeonProjectProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attribute)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attribute) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RegionId)) + { + writer.WritePropertyName("regionId"u8); + writer.WriteStringValue(RegionId); + } + if (Optional.IsDefined(Storage)) + { + writer.WritePropertyName("storage"u8); + writer.WriteNumberValue(Storage.Value); + } + if (Optional.IsDefined(PostgresVersion)) + { + writer.WritePropertyName("pgVersion"u8); + writer.WriteNumberValue(PostgresVersion.Value); + } + if (Optional.IsDefined(HistoryRetention)) + { + writer.WritePropertyName("historyRetention"u8); + writer.WriteNumberValue(HistoryRetention.Value); + } + if (Optional.IsDefined(DefaultEndpointSettings)) + { + writer.WritePropertyName("defaultEndpointSettings"u8); + writer.WriteObjectValue(DefaultEndpointSettings, options); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"u8); + writer.WriteObjectValue(Branch, options); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"u8); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Endpoints)) + { + writer.WritePropertyName("endpoints"u8); + writer.WriteStartArray(); + foreach (var item in Endpoints) + { + 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 + } + } + } + + NeonProjectProperties 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(NeonProjectProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonProjectProperties(document.RootElement, options); + } + + internal static NeonProjectProperties DeserializeNeonProjectProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string regionId = default; + long? storage = default; + int? pgVersion = default; + int? historyRetention = default; + DefaultEndpointSettings defaultEndpointSettings = default; + NeonBranchProperties branch = default; + IList roles = default; + IList databases = default; + IList endpoints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("regionId"u8)) + { + regionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("pgVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pgVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("historyRetention"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + historyRetention = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("defaultEndpointSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultEndpointSettings = DefaultEndpointSettings.DeserializeDefaultEndpointSettings(property.Value, options); + continue; + } + if (property.NameEquals("branch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + branch = NeonBranchProperties.DeserializeNeonBranchProperties(property.Value, options); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonRoleProperties.DeserializeNeonRoleProperties(item, options)); + } + roles = array; + continue; + } + if (property.NameEquals("databases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonDatabaseProperties.DeserializeNeonDatabaseProperties(item, options)); + } + databases = array; + continue; + } + if (property.NameEquals("endpoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonEndpointProperties.DeserializeNeonEndpointProperties(item, options)); + } + endpoints = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonProjectProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + regionId, + storage, + pgVersion, + historyRetention, + defaultEndpointSettings, + branch, + roles ?? new ChangeTrackingList(), + databases ?? new ChangeTrackingList(), + endpoints ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonProjectProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonProjectProperties 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 DeserializeNeonProjectProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonProjectProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs new file mode 100644 index 000000000000..b2793a39c170 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Project. + public partial class NeonProjectProperties + { + /// + /// 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 NeonProjectProperties() + { + Attribute = new ChangeTrackingList(); + Roles = new ChangeTrackingList(); + Databases = new ChangeTrackingList(); + Endpoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the project is created. + /// Data Storage bytes per hour for the project. + /// Postgres version for the project. + /// The retention period for project history in seconds. + /// Default endpoint settings for the project. + /// The Branch properties of the project. This is optional. + /// Roles associated with the project. + /// Neon Databases associated with the project. + /// Endpoints associated with the project. + /// Keeps track of any properties unknown to the library. + internal NeonProjectProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attribute, string regionId, long? storage, int? postgresVersion, int? historyRetention, DefaultEndpointSettings defaultEndpointSettings, NeonBranchProperties branch, IList roles, IList databases, IList endpoints, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attribute = attribute; + RegionId = regionId; + Storage = storage; + PostgresVersion = postgresVersion; + HistoryRetention = historyRetention; + DefaultEndpointSettings = defaultEndpointSettings; + Branch = branch; + Roles = roles; + Databases = databases; + Endpoints = endpoints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attribute { get; } + /// Region where the project is created. + public string RegionId { get; set; } + /// Data Storage bytes per hour for the project. + public long? Storage { get; set; } + /// Postgres version for the project. + public int? PostgresVersion { get; set; } + /// The retention period for project history in seconds. + public int? HistoryRetention { get; set; } + /// Default endpoint settings for the project. + public DefaultEndpointSettings DefaultEndpointSettings { get; set; } + /// The Branch properties of the project. This is optional. + public NeonBranchProperties Branch { get; set; } + /// Roles associated with the project. + public IList Roles { get; } + /// Neon Databases associated with the project. + public IList Databases { get; } + /// Endpoints associated with the project. + public IList Endpoints { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRole.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRole.Serialization.cs new file mode 100644 index 000000000000..ffe79a16f3a7 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRole.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class NeonRole : 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(NeonRole)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonRole 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(NeonRole)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonRole(document.RootElement, options); + } + + internal static NeonRole DeserializeNeonRole(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonRoleProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NeonRoleProperties.DeserializeNeonRoleProperties(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 NeonRole( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonRole)} does not support writing '{options.Format}' format."); + } + } + + NeonRole 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 DeserializeNeonRole(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonRole)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRole.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRole.cs new file mode 100644 index 000000000000..06e4b5f161cd --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRole.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The Neon Role resource type. + public partial class NeonRole : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NeonRole() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal NeonRole(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonRoleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonRoleProperties Properties { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.Serialization.cs new file mode 100644 index 000000000000..7006155cb021 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.NeonPostgres.Models +{ + internal partial class NeonRoleListResult : 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(NeonRoleListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NeonRoleListResult 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(NeonRoleListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonRoleListResult(document.RootElement, options); + } + + internal static NeonRoleListResult DeserializeNeonRoleListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonRole.DeserializeNeonRole(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonRoleListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonRoleListResult)} does not support writing '{options.Format}' format."); + } + } + + NeonRoleListResult 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 DeserializeNeonRoleListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonRoleListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.cs new file mode 100644 index 000000000000..40fadd65b4bb --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The response of a NeonRole list operation. + internal partial class NeonRoleListResult + { + /// + /// 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 NeonRole items on this page. + /// is null. + internal NeonRoleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NeonRole items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NeonRoleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NeonRoleListResult() + { + } + + /// The NeonRole items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs new file mode 100644 index 000000000000..8931ed3bdb1d --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs @@ -0,0 +1,251 @@ +// 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.NeonPostgres.Models +{ + public partial class NeonRoleProperties : 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(NeonRoleProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsSuperUser)) + { + writer.WritePropertyName("isSuperUser"u8); + writer.WriteBooleanValue(IsSuperUser.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 + } + } + } + + NeonRoleProperties 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(NeonRoleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonRoleProperties(document.RootElement, options); + } + + internal static NeonRoleProperties DeserializeNeonRoleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string branchId = default; + IList permissions = default; + bool? isSuperUser = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("permissions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + permissions = array; + continue; + } + if (property.NameEquals("isSuperUser"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSuperUser = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonRoleProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + branchId, + permissions ?? new ChangeTrackingList(), + isSuperUser, + 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(NeonRoleProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonRoleProperties 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 DeserializeNeonRoleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonRoleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.cs new file mode 100644 index 000000000000..d19464e943da --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Roles. + public partial class NeonRoleProperties + { + /// + /// 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 NeonRoleProperties() + { + Attributes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this role belongs to. + /// Permissions assigned to the role. + /// Indicates whether the role has superuser privileges. + /// Keeps track of any properties unknown to the library. + internal NeonRoleProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string branchId, IList permissions, bool? isSuperUser, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + BranchId = branchId; + Permissions = permissions; + IsSuperUser = isSuperUser; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the branch this role belongs to. + public string BranchId { get; set; } + /// Permissions assigned to the role. + public IList Permissions { get; } + /// Indicates whether the role has superuser privileges. + public bool? IsSuperUser { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.Serialization.cs new file mode 100644 index 000000000000..4e7d3b310594 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class PgVersion : 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(PgVersion)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version.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 + } + } + } + + PgVersion 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(PgVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePgVersion(document.RootElement, options); + } + + internal static PgVersion DeserializePgVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PgVersion(version, 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(PgVersion)} does not support writing '{options.Format}' format."); + } + } + + PgVersion 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 DeserializePgVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PgVersion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.cs new file mode 100644 index 000000000000..ece8eba8f59e --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// PostgreSQL Version model. + public partial class PgVersion + { + /// + /// 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 PgVersion() + { + } + + /// Initializes a new instance of . + /// The major PostgreSQL version number. + /// Keeps track of any properties unknown to the library. + internal PgVersion(int? version, IDictionary serializedAdditionalRawData) + { + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The major PostgreSQL version number. + public int? Version { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.Serialization.cs new file mode 100644 index 000000000000..800c3245dc86 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.Serialization.cs @@ -0,0 +1,136 @@ +// 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.NeonPostgres.Models +{ + public partial class PgVersionsResult : 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(PgVersionsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("versions"u8); + writer.WriteStartArray(); + foreach (var item in Versions) + { + 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 + } + } + } + + PgVersionsResult 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(PgVersionsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePgVersionsResult(document.RootElement, options); + } + + internal static PgVersionsResult DeserializePgVersionsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList versions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("versions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PgVersion.DeserializePgVersion(item, options)); + } + versions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PgVersionsResult(versions, 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(PgVersionsResult)} does not support writing '{options.Format}' format."); + } + } + + PgVersionsResult 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 DeserializePgVersionsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PgVersionsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.cs new file mode 100644 index 000000000000..deea19e022be --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Response model for PostgreSQL versions. + public partial class PgVersionsResult + { + /// + /// 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 . + /// List of PostgreSQL versions. + /// is null. + internal PgVersionsResult(IEnumerable versions) + { + Argument.AssertNotNull(versions, nameof(versions)); + + Versions = versions.ToList(); + } + + /// Initializes a new instance of . + /// List of PostgreSQL versions. + /// Keeps track of any properties unknown to the library. + internal PgVersionsResult(IReadOnlyList versions, IDictionary serializedAdditionalRawData) + { + Versions = versions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PgVersionsResult() + { + } + + /// List of PostgreSQL versions. + public IReadOnlyList Versions { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.Serialization.cs new file mode 100644 index 000000000000..cf5f6370de3b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.Serialization.cs @@ -0,0 +1,151 @@ +// 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.NeonPostgres.Models +{ + internal partial class ProjectListResult : 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(ProjectListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectListResult 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(ProjectListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectListResult(document.RootElement, options); + } + + internal static ProjectListResult DeserializeProjectListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonProjectData.DeserializeNeonProjectData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectListResult)} does not support writing '{options.Format}' format."); + } + } + + ProjectListResult 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 DeserializeProjectListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.cs new file mode 100644 index 000000000000..adeaffeba3dc --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// The response of a Project list operation. + internal partial class ProjectListResult + { + /// + /// 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 Project items on this page. + /// is null. + internal ProjectListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Project items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ProjectListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectListResult() + { + } + + /// The Project items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchCollection.cs new file mode 100644 index 000000000000..2e45f52e2337 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchCollection.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.NeonPostgres +{ + /// + /// 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 GetNeonBranches method from an instance of . + /// + public partial class NeonBranchCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _neonBranchBranchesClientDiagnostics; + private readonly BranchesRestOperations _neonBranchBranchesRestClient; + + /// Initializes a new instance of the class for mocking. + protected NeonBranchCollection() + { + } + + /// 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 NeonBranchCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonBranchBranchesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", NeonBranchResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NeonBranchResource.ResourceType, out string neonBranchBranchesApiVersion); + _neonBranchBranchesRestClient = new BranchesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonBranchBranchesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != NeonProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NeonProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Branch. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string branchName, NeonBranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonBranchOperationSource(Client), _neonBranchBranchesClientDiagnostics, Pipeline, _neonBranchBranchesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Branch. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string branchName, NeonBranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonBranchOperationSource(Client), _neonBranchBranchesClientDiagnostics, Pipeline, _neonBranchBranchesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.Get"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonBranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.Get"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonBranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Branch resources by Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches + /// + /// + /// Operation Id + /// Branch_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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) => _neonBranchBranchesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonBranchBranchesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NeonBranchResource(Client, NeonBranchData.DeserializeNeonBranchData(e)), _neonBranchBranchesClientDiagnostics, Pipeline, "NeonBranchCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Branch resources by Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches + /// + /// + /// Operation Id + /// Branch_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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) => _neonBranchBranchesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonBranchBranchesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NeonBranchResource(Client, NeonBranchData.DeserializeNeonBranchData(e)), _neonBranchBranchesClientDiagnostics, Pipeline, "NeonBranchCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.Exists"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.Exists"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonBranchResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchCollection.GetIfExists"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonBranchResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchData.Serialization.cs new file mode 100644 index 000000000000..cbb4e5e1dd41 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class NeonBranchData : 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(NeonBranchData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonBranchData 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(NeonBranchData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonBranchData(document.RootElement, options); + } + + internal static NeonBranchData DeserializeNeonBranchData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonBranchProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NeonBranchProperties.DeserializeNeonBranchProperties(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 NeonBranchData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonBranchData)} does not support writing '{options.Format}' format."); + } + } + + NeonBranchData 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 DeserializeNeonBranchData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonBranchData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchData.cs new file mode 100644 index 000000000000..031fdbb0b714 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the NeonBranch data model. + /// The Branch resource type. + /// + public partial class NeonBranchData : 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 NeonBranchData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal NeonBranchData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonBranchProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonBranchProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchResource.Serialization.cs new file mode 100644 index 000000000000..1560fee0f334 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchResource.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.NeonPostgres +{ + public partial class NeonBranchResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NeonBranchData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + NeonBranchData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchResource.cs new file mode 100644 index 000000000000..1c4f7ce94bec --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonBranchResource.cs @@ -0,0 +1,578 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A Class representing a NeonBranch 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 GetNeonBranchResource method. + /// Otherwise you can get one from its parent resource using the GetNeonBranch method. + /// + public partial class NeonBranchResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + /// The branchName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _neonBranchBranchesClientDiagnostics; + private readonly BranchesRestOperations _neonBranchBranchesRestClient; + private readonly ClientDiagnostics _computesClientDiagnostics; + private readonly ComputesRestOperations _computesRestClient; + private readonly ClientDiagnostics _neonDatabasesClientDiagnostics; + private readonly NeonDatabasesRestOperations _neonDatabasesRestClient; + private readonly ClientDiagnostics _neonRolesClientDiagnostics; + private readonly NeonRolesRestOperations _neonRolesRestClient; + private readonly ClientDiagnostics _endpointsClientDiagnostics; + private readonly EndpointsRestOperations _endpointsRestClient; + private readonly NeonBranchData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects/branches"; + + /// Initializes a new instance of the class for mocking. + protected NeonBranchResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NeonBranchResource(ArmClient client, NeonBranchData 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 NeonBranchResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonBranchBranchesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string neonBranchBranchesApiVersion); + _neonBranchBranchesRestClient = new BranchesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonBranchBranchesApiVersion); + _computesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _computesRestClient = new ComputesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _neonDatabasesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _neonDatabasesRestClient = new NeonDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _neonRolesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _neonRolesRestClient = new NeonRolesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _endpointsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _endpointsRestClient = new EndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual NeonBranchData 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 Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchResource.Get"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.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 NeonBranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchResource.Get"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.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 NeonBranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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 = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchResource.Delete"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _neonBranchBranchesRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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 = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchResource.Delete"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _neonBranchBranchesRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NeonBranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchResource.Update"); + scope.Start(); + try + { + var response = await _neonBranchBranchesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonBranchOperationSource(Client), _neonBranchBranchesClientDiagnostics, Pipeline, _neonBranchBranchesRestClient.CreateCreateOrUpdateRequest(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; + } + } + + /// + /// Create a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, NeonBranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonBranchBranchesClientDiagnostics.CreateScope("NeonBranchResource.Update"); + scope.Start(); + try + { + var response = _neonBranchBranchesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonBranchOperationSource(Client), _neonBranchBranchesClientDiagnostics, Pipeline, _neonBranchBranchesRestClient.CreateCreateOrUpdateRequest(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; + } + } + + /// + /// List Compute resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes + /// + /// + /// Operation Id + /// Compute_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetComputesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NeonCompute.DeserializeNeonCompute(e), _computesClientDiagnostics, Pipeline, "NeonBranchResource.GetComputes", "value", "nextLink", cancellationToken); + } + + /// + /// List Compute resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes + /// + /// + /// Operation Id + /// Compute_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetComputes(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NeonCompute.DeserializeNeonCompute(e), _computesClientDiagnostics, Pipeline, "NeonBranchResource.GetComputes", "value", "nextLink", cancellationToken); + } + + /// + /// List NeonDatabase resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases + /// + /// + /// Operation Id + /// NeonDatabase_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNeonDatabasesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _neonDatabasesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonDatabasesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NeonDatabase.DeserializeNeonDatabase(e), _neonDatabasesClientDiagnostics, Pipeline, "NeonBranchResource.GetNeonDatabases", "value", "nextLink", cancellationToken); + } + + /// + /// List NeonDatabase resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases + /// + /// + /// Operation Id + /// NeonDatabase_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNeonDatabases(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _neonDatabasesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonDatabasesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NeonDatabase.DeserializeNeonDatabase(e), _neonDatabasesClientDiagnostics, Pipeline, "NeonBranchResource.GetNeonDatabases", "value", "nextLink", cancellationToken); + } + + /// + /// List NeonRole resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles + /// + /// + /// Operation Id + /// NeonRole_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNeonRolesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _neonRolesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NeonRole.DeserializeNeonRole(e), _neonRolesClientDiagnostics, Pipeline, "NeonBranchResource.GetNeonRoles", "value", "nextLink", cancellationToken); + } + + /// + /// List NeonRole resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles + /// + /// + /// Operation Id + /// NeonRole_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNeonRoles(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _neonRolesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NeonRole.DeserializeNeonRole(e), _neonRolesClientDiagnostics, Pipeline, "NeonBranchResource.GetNeonRoles", "value", "nextLink", cancellationToken); + } + + /// + /// List Endpoint resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEndpointsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NeonEndpoint.DeserializeNeonEndpoint(e), _endpointsClientDiagnostics, Pipeline, "NeonBranchResource.GetEndpoints", "value", "nextLink", cancellationToken); + } + + /// + /// List Endpoint resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEndpoints(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NeonEndpoint.DeserializeNeonEndpoint(e), _endpointsClientDiagnostics, Pipeline, "NeonBranchResource.GetEndpoints", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs index 29184c380db9..c4259daa0a47 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string or /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string organizationName, C /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string organizationName, C /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string organizationName, CancellationToken /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs index ac4517a26e4a..947ebd253e4d 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs @@ -89,6 +89,75 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of NeonProjectResources in the NeonOrganization. + /// An object representing collection of NeonProjectResources and their operations over a NeonProjectResource. + public virtual NeonProjectCollection GetNeonProjects() + { + return GetCachedClient(client => new NeonProjectCollection(client, Id)); + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNeonProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + return await GetNeonProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNeonProject(string projectName, CancellationToken cancellationToken = default) + { + return GetNeonProjects().Get(projectName, cancellationToken); + } + /// /// Get a OrganizationResource /// @@ -102,7 +171,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -142,7 +211,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -182,7 +251,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -224,7 +293,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -266,7 +335,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -312,7 +381,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -358,7 +427,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -420,7 +489,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -482,7 +551,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -539,7 +608,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -596,7 +665,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -656,7 +725,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectCollection.cs new file mode 100644 index 000000000000..478732f903f8 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectCollection.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.NeonPostgres +{ + /// + /// 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 GetNeonProjects method from an instance of . + /// + public partial class NeonProjectCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _neonProjectProjectsClientDiagnostics; + private readonly ProjectsRestOperations _neonProjectProjectsRestClient; + + /// Initializes a new instance of the class for mocking. + protected NeonProjectCollection() + { + } + + /// 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 NeonProjectCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonProjectProjectsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", NeonProjectResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NeonProjectResource.ResourceType, out string neonProjectProjectsApiVersion); + _neonProjectProjectsRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonProjectProjectsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != NeonOrganizationResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NeonOrganizationResource.ResourceType), nameof(id)); + } + + /// + /// Create a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Project. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string projectName, NeonProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonProjectOperationSource(Client), _neonProjectProjectsClientDiagnostics, Pipeline, _neonProjectProjectsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Project. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string projectName, NeonProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonProjectOperationSource(Client), _neonProjectProjectsClientDiagnostics, Pipeline, _neonProjectProjectsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.Get"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.Get"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Project resources by OrganizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects + /// + /// + /// Operation Id + /// Project_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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) => _neonProjectProjectsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonProjectProjectsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NeonProjectResource(Client, NeonProjectData.DeserializeNeonProjectData(e)), _neonProjectProjectsClientDiagnostics, Pipeline, "NeonProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Project resources by OrganizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects + /// + /// + /// Operation Id + /// Project_List + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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) => _neonProjectProjectsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonProjectProjectsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NeonProjectResource(Client, NeonProjectData.DeserializeNeonProjectData(e)), _neonProjectProjectsClientDiagnostics, Pipeline, "NeonProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.Exists"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.Exists"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonProjectResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonProjectResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectData.Serialization.cs new file mode 100644 index 000000000000..49c55fdcbf32 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class NeonProjectData : 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(NeonProjectData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonProjectData 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(NeonProjectData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonProjectData(document.RootElement, options); + } + + internal static NeonProjectData DeserializeNeonProjectData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonProjectProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NeonProjectProperties.DeserializeNeonProjectProperties(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 NeonProjectData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NeonProjectData)} does not support writing '{options.Format}' format."); + } + } + + NeonProjectData 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 DeserializeNeonProjectData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonProjectData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectData.cs new file mode 100644 index 000000000000..55570b6c3f52 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the NeonProject data model. + /// The Project resource type. + /// + public partial class NeonProjectData : 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 NeonProjectData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal NeonProjectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonProjectProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonProjectProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectResource.Serialization.cs new file mode 100644 index 000000000000..6ade8bda0abc --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectResource.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.NeonPostgres +{ + public partial class NeonProjectResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NeonProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + NeonProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectResource.cs new file mode 100644 index 000000000000..8eaad5948cb8 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonProjectResource.cs @@ -0,0 +1,505 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A Class representing a NeonProject 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 GetNeonProjectResource method. + /// Otherwise you can get one from its parent resource using the GetNeonProject method. + /// + public partial class NeonProjectResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _neonProjectProjectsClientDiagnostics; + private readonly ProjectsRestOperations _neonProjectProjectsRestClient; + private readonly NeonProjectData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects"; + + /// Initializes a new instance of the class for mocking. + protected NeonProjectResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NeonProjectResource(ArmClient client, NeonProjectData 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 NeonProjectResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonProjectProjectsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string neonProjectProjectsApiVersion); + _neonProjectProjectsRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonProjectProjectsApiVersion); +#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 NeonProjectData 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 NeonBranchResources in the NeonProject. + /// An object representing collection of NeonBranchResources and their operations over a NeonBranchResource. + public virtual NeonBranchCollection GetNeonBranches() + { + return GetCachedClient(client => new NeonBranchCollection(client, Id)); + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNeonBranchAsync(string branchName, CancellationToken cancellationToken = default) + { + return await GetNeonBranches().GetAsync(branchName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNeonBranch(string branchName, CancellationToken cancellationToken = default) + { + return GetNeonBranches().Get(branchName, cancellationToken); + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.Get"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.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 NeonProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.Get"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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 = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.Delete"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _neonProjectProjectsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Delete + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// 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 = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.Delete"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _neonProjectProjectsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NeonProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.Update"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonProjectOperationSource(Client), _neonProjectProjectsClientDiagnostics, Pipeline, _neonProjectProjectsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, NeonProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.Update"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonProjectOperationSource(Client), _neonProjectProjectsClientDiagnostics, Pipeline, _neonProjectProjectsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to retrieve the connection URI for the Neon Database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/getConnectionUri + /// + /// + /// Operation Id + /// Projects_GetConnectionUri + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetConnectionUriAsync(ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.GetConnectionUri"); + scope.Start(); + try + { + var response = await _neonProjectProjectsRestClient.GetConnectionUriAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionUriParameters, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to retrieve the connection URI for the Neon Database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/getConnectionUri + /// + /// + /// Operation Id + /// Projects_GetConnectionUri + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// is null. + public virtual Response GetConnectionUri(ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var scope = _neonProjectProjectsClientDiagnostics.CreateScope("NeonProjectResource.GetConnectionUri"); + scope.Start(); + try + { + var response = _neonProjectProjectsRestClient.GetConnectionUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionUriParameters, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.cs new file mode 100644 index 000000000000..5eae14d04a84 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class BranchesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BranchesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BranchesRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonBranchData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonBranchData.DeserializeNeonBranchData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonBranchData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonBranchData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonBranchData.DeserializeNeonBranchData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonBranchData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, NeonBranchData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, NeonBranchData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, NeonBranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, NeonBranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, 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 organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Branch resources by Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Branch resources by Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Branch resources by Project. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Branch resources by Project. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs new file mode 100644 index 000000000000..d6025e00002a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs @@ -0,0 +1,241 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class ComputesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ComputesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ComputesRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Compute resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Compute resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Compute resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Compute resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs new file mode 100644 index 000000000000..cc3582501985 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs @@ -0,0 +1,241 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class EndpointsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public EndpointsRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Endpoint resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Endpoint resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Endpoint resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Endpoint resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs new file mode 100644 index 000000000000..7d0481be807c --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs @@ -0,0 +1,241 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class NeonDatabasesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NeonDatabasesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public NeonDatabasesRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List NeonDatabase resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonDatabase resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List NeonDatabase resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonDatabase resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs new file mode 100644 index 000000000000..ad0c99b78c82 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs @@ -0,0 +1,241 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class NeonRolesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NeonRolesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public NeonRolesRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List NeonRole resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonRole resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List NeonRole resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonRole resources by Branch. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs index e528c86be1c8..c63d449c2906 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs @@ -32,7 +32,7 @@ public OrganizationsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-08-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -564,6 +564,101 @@ public Response ListBySubscription(string subscr } } + internal RequestUriBuilder CreateGetPostgresVersionsRequestUri(string subscriptionId, string resourceGroupName, PgVersion pgVersion) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/getPostgresVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetPostgresVersionsRequest(string subscriptionId, string resourceGroupName, PgVersion pgVersion) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/getPostgresVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (pgVersion != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(pgVersion, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Action to retrieve the PostgreSQL versions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetPostgresVersionsAsync(string subscriptionId, string resourceGroupName, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateGetPostgresVersionsRequest(subscriptionId, resourceGroupName, pgVersion); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PgVersionsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PgVersionsResult.DeserializePgVersionsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Action to retrieve the PostgreSQL versions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetPostgresVersions(string subscriptionId, string resourceGroupName, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateGetPostgresVersionsRequest(subscriptionId, resourceGroupName, pgVersion); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PgVersionsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PgVersionsResult.DeserializePgVersionsResult(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(); diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.cs new file mode 100644 index 000000000000..88289ff86ea9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.cs @@ -0,0 +1,623 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class ProjectsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProjectsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ProjectsRestOperations(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-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonProjectData.DeserializeNeonProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonProjectData.DeserializeNeonProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, NeonProjectData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, NeonProjectData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, NeonProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string organizationName, string projectName, NeonProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, 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 organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Project resources by OrganizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// 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 organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Project resources by OrganizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// 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 organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetConnectionUriRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/getConnectionUri", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetConnectionUriRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/getConnectionUri", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionUriParameters, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Action to retrieve the connection URI for the Neon Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetConnectionUriAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var message = CreateGetConnectionUriRequest(subscriptionId, resourceGroupName, organizationName, projectName, connectionUriParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionUriProperties value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionUriProperties.DeserializeConnectionUriProperties(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Action to retrieve the connection URI for the Neon Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetConnectionUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var message = CreateGetConnectionUriRequest(subscriptionId, resourceGroupName, organizationName, projectName, connectionUriParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionUriProperties value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionUriProperties.DeserializeConnectionUriProperties(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Project resources by OrganizationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// 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 organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Project resources by OrganizationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// 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 organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml index 4216dd4fa9fb..c745b44e3c35 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/liftrneon/Neon.Postgres.Management -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 +commit: 9990ef08cbc4199a0ebea96403a23de493df11d7 repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/