From 6ad7964eee1e145b1f9e769a6d0750be8602bcf7 Mon Sep 17 00:00:00 2001 From: VIPRAY JAIN Date: Wed, 3 Jul 2024 17:17:46 +0530 Subject: [PATCH 1/7] Updating dotnet sdk for NewRelic --- ...er.NewRelicObservability.netstandard2.0.cs | 250 +++++++- ...MonitoredSubscriptionPropertyCollection.cs | 201 ++++++ ...e_MonitoredSubscriptionPropertyResource.cs | 112 ++++ .../Samples/Sample_NewRelicMonitorResource.cs | 193 ++++-- ...ample_NewRelicMonitorResourceCollection.cs | 24 +- ..._NewRelicObservabilityTagRuleCollection.cs | 40 +- ...le_NewRelicObservabilityTagRuleResource.cs | 24 +- .../Sample_SubscriptionResourceExtensions.cs | 27 +- .../ArmNewRelicObservabilityModelFactory.cs | 130 +++- .../MockableNewRelicObservabilityArmClient.cs | 12 + ...RelicObservabilityResourceGroupResource.cs | 4 +- ...wRelicObservabilitySubscriptionResource.cs | 16 +- .../NewRelicObservabilityExtensions.cs | 39 +- ...oredSubscriptionPropertyOperationSource.cs | 38 ++ .../Models/BillingInfoResult.Serialization.cs | 141 ++++ .../src/Generated/Models/BillingInfoResult.cs | 69 ++ .../src/Generated/Models/ConfigurationName.cs | 48 ++ ...PartnerResourceProperties.Serialization.cs | 159 +++++ .../ConnectedPartnerResourceProperties.cs | 78 +++ ...artnerResourcesListFormat.Serialization.cs | 126 ++++ .../ConnectedPartnerResourcesListFormat.cs | 65 ++ ...tnerResourcesListResponse.Serialization.cs | 147 +++++ .../ConnectedPartnerResourcesListResponse.cs | 70 ++ ...inkedResourceListResponse.Serialization.cs | 148 +++++ .../Models/LinkedResourceListResponse.cs | 71 ++ .../MarketplaceSaaSInfo.Serialization.cs | 172 +++++ .../Generated/Models/MarketplaceSaaSInfo.cs | 81 +++ .../MonitoredSubscription.Serialization.cs | 163 +++++ .../Generated/Models/MonitoredSubscription.cs | 77 +++ ...ubscriptionPropertiesList.Serialization.cs | 147 +++++ .../MonitoredSubscriptionPropertiesList.cs | 70 ++ ...itoringTagRulesProperties.Serialization.cs | 156 +++++ .../Models/MonitoringTagRulesProperties.cs | 73 +++ .../Models/NewRelicAccountResourceData.cs | 4 +- .../NewRelicObservabilityAccountInfo.cs | 4 +- .../NewRelicPlanDetails.Serialization.cs | 10 +- .../Generated/Models/NewRelicPlanDetails.cs | 8 +- .../PartnerBillingEntity.Serialization.cs | 133 ++++ .../Generated/Models/PartnerBillingEntity.cs | 69 ++ .../src/Generated/Models/PatchOperation.cs | 60 ++ .../src/Generated/Models/Status.cs | 57 ++ .../Models/SubscriptionList.Serialization.cs | 166 +++++ .../src/Generated/Models/SubscriptionList.cs | 74 +++ ...MonitoredSubscriptionPropertyCollection.cs | 466 ++++++++++++++ ...dSubscriptionPropertyData.Serialization.cs | 182 ++++++ .../MonitoredSubscriptionPropertyData.cs | 75 +++ ...scriptionPropertyResource.Serialization.cs | 26 + .../MonitoredSubscriptionPropertyResource.cs | 348 ++++++++++ .../src/Generated/NewRelicMonitorResource.cs | 395 ++++++++++-- .../NewRelicMonitorResourceCollection.cs | 20 +- ...wRelicMonitorResourceData.Serialization.cs | 24 + .../Generated/NewRelicMonitorResourceData.cs | 10 +- .../NewRelicObservabilityTagRuleCollection.cs | 20 +- .../NewRelicObservabilityTagRuleResource.cs | 12 +- .../RestOperations/AccountsRestOperations.cs | 2 +- .../BillingInfoRestOperations.cs | 133 ++++ ...ConnectedPartnerResourcesRestOperations.cs | 228 +++++++ .../MonitoredSubscriptionsRestOperations.cs | 605 ++++++++++++++++++ .../RestOperations/MonitorsRestOperations.cs | 200 +++++- .../OrganizationsRestOperations.cs | 2 +- .../RestOperations/PlansRestOperations.cs | 2 +- .../RestOperations/TagRulesRestOperations.cs | 2 +- .../src/autorest.md | 3 +- 63 files changed, 6259 insertions(+), 252 deletions(-) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/ConnectedPartnerResourcesRestOperations.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs index 4b2136d1200fd..770ef1de21fc1 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs @@ -1,5 +1,51 @@ namespace Azure.ResourceManager.NewRelicObservability { + public partial class MonitoredSubscriptionPropertyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MonitoredSubscriptionPropertyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, 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(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, 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 MonitoredSubscriptionPropertyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitoredSubscriptionPropertyData() { } + public Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList Properties { get { throw null; } set { } } + Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitoredSubscriptionPropertyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MonitoredSubscriptionPropertyResource() { } + public virtual Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NewRelicMonitorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -15,14 +61,23 @@ protected NewRelicMonitorResource() { } public virtual Azure.Pageable GetAppServices(Azure.ResourceManager.NewRelicObservability.Models.NewRelicAppServicesGetContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAppServicesAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicAppServicesGetContent content, 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 GetBillingInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBillingInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetConnectedPartnerResources(string body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConnectedPartnerResourcesAsync(string body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHosts(Azure.ResourceManager.NewRelicObservability.Models.NewRelicHostsGetContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHostsAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicHostsGetContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetLinkedResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetLinkedResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMetricRules(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMetricRulesAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMetricStatus(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMetricStatusAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetMonitoredResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetMonitoredResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionProperties() { throw null; } + public virtual Azure.Response GetMonitoredSubscriptionProperty(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMonitoredSubscriptionPropertyAsync(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetNewRelicObservabilityTagRule(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNewRelicObservabilityTagRuleAsync(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.NewRelicObservability.NewRelicObservabilityTagRuleCollection GetNewRelicObservabilityTagRules() { throw null; } @@ -37,8 +92,8 @@ protected NewRelicMonitorResource() { } Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response VmHostPayload(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> VmHostPayloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -73,6 +128,8 @@ public NewRelicMonitorResourceData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? OrgCreationSource { get { throw null; } set { } } public Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails PlanData { get { throw null; } set { } } public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } + public string SaaSAzureSubscriptionStatus { get { throw null; } set { } } + public string SubscriptionState { get { throw null; } set { } } public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUserInfo UserInfo { get { throw null; } set { } } Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -82,6 +139,7 @@ public NewRelicMonitorResourceData(Azure.Core.AzureLocation location) { } } public static partial class NewRelicObservabilityExtensions { + public static Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetNewRelicAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string userEmail, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNewRelicAccountsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string userEmail, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResource GetNewRelicMonitorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -150,6 +208,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Mocking public partial class MockableNewRelicObservabilityArmClient : Azure.ResourceManager.ArmResource { protected MockableNewRelicObservabilityArmClient() { } + public virtual Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResource GetNewRelicMonitorResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NewRelicObservability.NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -177,12 +236,20 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { public static partial class ArmNewRelicObservabilityModelFactory { + public static Azure.ResourceManager.NewRelicObservability.Models.BillingInfoResult BillingInfoResult(Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo marketplaceSaasInfo = null, Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity partnerBillingEntity = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties ConnectedPartnerResourceProperties(string accountName = null, string accountId = null, string azureResourceId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourcesListFormat ConnectedPartnerResourcesListFormat(Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo MarketplaceSaaSInfo(string marketplaceSubscriptionId = null, string marketplaceSubscriptionName = null, string marketplaceResourceId = null, string marketplaceStatus = null, string billedAzureSubscriptionId = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData MonitoredSubscriptionPropertyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList properties = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties MonitoringTagRulesProperties(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules logRules = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules metricRules = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountResourceData NewRelicAccountResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string organizationId = null, string accountId = null, string accountName = null, Azure.Core.AzureLocation? region = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicAppServicesGetContent NewRelicAppServicesGetContent(System.Collections.Generic.IEnumerable azureResourceIds = null, string userEmail = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicHostsGetContent NewRelicHostsGetContent(System.Collections.Generic.IEnumerable vmIds = null, string userEmail = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusContent NewRelicMetricsStatusContent(System.Collections.Generic.IEnumerable azureResourceIds = null, string userEmail = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusResult NewRelicMetricsStatusResult(System.Collections.Generic.IEnumerable azureResourceIds = null) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData NewRelicMonitorResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus? monitoringStatus = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus?), string marketplaceSubscriptionId = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountProperties newRelicAccountProperties = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUserInfo userInfo = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory? liftrResourceCategory = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory?), int? liftrResourcePreference = default(int?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? orgCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource? accountCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData NewRelicMonitorResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus? monitoringStatus, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string marketplaceSubscriptionId, Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountProperties newRelicAccountProperties, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUserInfo userInfo, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData, Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory? liftrResourceCategory, int? liftrResourcePreference, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? orgCreationSource, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource? accountCreationSource) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData NewRelicMonitorResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus? monitoringStatus = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus?), string marketplaceSubscriptionId = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountProperties newRelicAccountProperties = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUserInfo userInfo = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory? liftrResourceCategory = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory?), int? liftrResourcePreference = default(int?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? orgCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource? accountCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource?), string subscriptionState = null, string saaSAzureSubscriptionStatus = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAppServiceInfo NewRelicObservabilityAppServiceInfo(Azure.Core.ResourceIdentifier azureResourceId = null, string agentVersion = null, string agentStatus = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.NewRelicObservabilityTagRuleData NewRelicObservabilityTagRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules logRules = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules metricRules = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityVmExtensionPayload NewRelicObservabilityVmExtensionPayload(string ingestionKey = null) { throw null; } @@ -191,6 +258,98 @@ public static partial class ArmNewRelicObservabilityModelFactory public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanData NewRelicPlanData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? orgCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource? accountCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource?)) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicResourceMonitorResult NewRelicResourceMonitorResult(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingMetricsStatus? sendingMetrics = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingMetricsStatus?), string reasonForMetricsStatus = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingLogsStatus? sendingLogs = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingLogsStatus?), string reasonForLogsStatus = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicSwitchBillingContent NewRelicSwitchBillingContent(Azure.Core.ResourceIdentifier azureResourceId = null, string organizationId = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData = null, string userEmail = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity PartnerBillingEntity(string organizationId = null, string organizationName = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList SubscriptionList(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation? patchOperation = default(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation?), System.Collections.Generic.IEnumerable monitoredSubscriptionList = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?)) { throw null; } + } + public partial class BillingInfoResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BillingInfoResult() { } + public Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo MarketplaceSaasInfo { get { throw null; } } + public Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity PartnerBillingEntity { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.BillingInfoResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.BillingInfoResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ConfigurationName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConfigurationName(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName Default { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName 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.NewRelicObservability.Models.ConfigurationName left, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName left, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedPartnerResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConnectedPartnerResourceProperties() { } + public string AccountId { get { throw null; } } + public string AccountName { get { throw null; } } + public string AzureResourceId { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedPartnerResourcesListFormat : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConnectedPartnerResourcesListFormat() { } + public Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties Properties { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourcesListFormat System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourcesListFormat System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketplaceSaaSInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketplaceSaaSInfo() { } + public string BilledAzureSubscriptionId { get { throw null; } } + public string MarketplaceResourceId { get { throw null; } } + public string MarketplaceStatus { get { throw null; } } + public string MarketplaceSubscriptionId { get { throw null; } } + public string MarketplaceSubscriptionName { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitoredSubscription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitoredSubscription() { } + public string Error { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.Status? Status { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties TagRules { get { throw null; } set { } } + Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitoringTagRulesProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitoringTagRulesProperties() { } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules LogRules { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules MetricRules { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class NewRelicAccountProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -348,25 +507,6 @@ internal NewRelicObservabilityAppServiceInfo() { } 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 NewRelicObservabilityBillingCycle : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public NewRelicObservabilityBillingCycle(string value) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle Monthly { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle Weekly { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle Yearly { get { throw null; } } - public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle 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.NewRelicObservability.Models.NewRelicObservabilityBillingCycle left, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle right) { throw null; } - public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle left, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct NewRelicObservabilityBillingSource : System.IEquatable { private readonly object _dummy; @@ -693,7 +833,7 @@ public NewRelicPlanData() { } public partial class NewRelicPlanDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NewRelicPlanDetails() { } - public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle? BillingCycle { get { throw null; } set { } } + public string BillingCycle { get { throw null; } set { } } public System.DateTimeOffset? EffectiveOn { get { throw null; } set { } } public string PlanDetails { get { throw null; } set { } } public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUsageType? UsageType { get { throw null; } set { } } @@ -788,4 +928,68 @@ public NewRelicSwitchBillingContent(string userEmail) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PartnerBillingEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PartnerBillingEntity() { } + public string OrganizationId { get { throw null; } } + public string OrganizationName { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 PatchOperation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchOperation(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation Active { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation AddBegin { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation AddComplete { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation DeleteBegin { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation DeleteComplete { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation 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.NewRelicObservability.Models.PatchOperation left, Azure.ResourceManager.NewRelicObservability.Models.PatchOperation right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.PatchOperation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation left, Azure.ResourceManager.NewRelicObservability.Models.PatchOperation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Status : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Status(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.Status Active { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.Status Deleting { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.Status Failed { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.Status InProgress { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.Status 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.NewRelicObservability.Models.Status left, Azure.ResourceManager.NewRelicObservability.Models.Status right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.Status (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.Status left, Azure.ResourceManager.NewRelicObservability.Models.Status right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubscriptionList : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SubscriptionList() { } + public System.Collections.Generic.IList MonitoredSubscriptionList { get { throw null; } } + public Azure.ResourceManager.NewRelicObservability.Models.PatchOperation? PatchOperation { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs new file mode 100644 index 0000000000000..88129c10b2f4b --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability.Samples +{ + public partial class Sample_MonitoredSubscriptionPropertyCollection + { + // Monitors_GetMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_List.json + // this example is just showing the usage of "MonitoredSubscriptions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation and iterate over the result + await foreach (MonitoredSubscriptionPropertyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MonitoredSubscriptionPropertyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Monitors_GetMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + ConfigurationName configurationName = ConfigurationName.Default; + MonitoredSubscriptionPropertyResource result = await collection.GetAsync(configurationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MonitoredSubscriptionPropertyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Monitors_GetMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + ConfigurationName configurationName = ConfigurationName.Default; + bool result = await collection.ExistsAsync(configurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Monitors_GetMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + ConfigurationName configurationName = ConfigurationName.Default; + NullableResponse response = await collection.GetIfExistsAsync(configurationName); + MonitoredSubscriptionPropertyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MonitoredSubscriptionPropertyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Monitors_AddMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_MonitorsAddMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_CreateOrUpdate.json + // this example is just showing the usage of "MonitoredSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + ConfigurationName configurationName = ConfigurationName.Default; + MonitoredSubscriptionPropertyData data = new MonitoredSubscriptionPropertyData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, data); + MonitoredSubscriptionPropertyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MonitoredSubscriptionPropertyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs new file mode 100644 index 0000000000000..8bc14074ddd08 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability.Samples +{ + public partial class Sample_MonitoredSubscriptionPropertyResource + { + // Monitors_GetMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MonitoredSubscriptionPropertyResource created on azure + // for more information of creating MonitoredSubscriptionPropertyResource, please refer to the document of MonitoredSubscriptionPropertyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ConfigurationName configurationName = ConfigurationName.Default; + ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + + // invoke the operation + MonitoredSubscriptionPropertyResource result = await monitoredSubscriptionProperty.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MonitoredSubscriptionPropertyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Monitors_UpdateMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_MonitorsUpdateMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_Update.json + // this example is just showing the usage of "MonitoredSubscriptions_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MonitoredSubscriptionPropertyResource created on azure + // for more information of creating MonitoredSubscriptionPropertyResource, please refer to the document of MonitoredSubscriptionPropertyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ConfigurationName configurationName = ConfigurationName.Default; + ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + + // invoke the operation + MonitoredSubscriptionPropertyData data = new MonitoredSubscriptionPropertyData(); + ArmOperation lro = await monitoredSubscriptionProperty.UpdateAsync(WaitUntil.Completed, data); + MonitoredSubscriptionPropertyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MonitoredSubscriptionPropertyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Monitors_DeleteMonitoredSubscriptions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_MonitorsDeleteMonitoredSubscriptions() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/MonitoredSubscriptions_Delete.json + // this example is just showing the usage of "MonitoredSubscriptions_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MonitoredSubscriptionPropertyResource created on azure + // for more information of creating MonitoredSubscriptionPropertyResource, please refer to the document of MonitoredSubscriptionPropertyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ConfigurationName configurationName = ConfigurationName.Default; + ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + + // invoke the operation + await monitoredSubscriptionProperty.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs index 68f991ccba4ae..264ec89e09a59 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs @@ -12,6 +12,7 @@ using Azure.ResourceManager.Models; using Azure.ResourceManager.NewRelicObservability.Models; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.NewRelicObservability.Samples { @@ -22,7 +23,7 @@ public partial class Sample_NewRelicMonitorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicMonitorResources_MonitorsListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,7 +33,7 @@ public async Task GetNewRelicMonitorResources_MonitorsListBySubscriptionMaximumS // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -54,7 +55,7 @@ public async Task GetNewRelicMonitorResources_MonitorsListBySubscriptionMaximumS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MonitorsGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Get_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +65,7 @@ public async Task Get_MonitorsGetMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "cdlymktqw"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -85,7 +86,7 @@ public async Task Get_MonitorsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_MonitorsUpdateMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Update_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +96,7 @@ public async Task Update_MonitorsUpdateMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "cdlymktqw"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -144,14 +145,15 @@ public async Task Update_MonitorsUpdateMaximumSetGen() PlanData = new NewRelicPlanDetails() { UsageType = NewRelicObservabilityUsageType.Payg, - BillingCycle = NewRelicObservabilityBillingCycle.Yearly, + BillingCycle = "Yearly", PlanDetails = "tbbiaga", EffectiveOn = DateTimeOffset.Parse("2022-12-05T14:11:37.786Z"), }, OrgCreationSource = NewRelicObservabilityOrgCreationSource.Liftr, AccountCreationSource = NewRelicObservabilityAccountCreationSource.Liftr, }; - NewRelicMonitorResource result = await newRelicMonitorResource.UpdateAsync(patch); + ArmOperation lro = await newRelicMonitorResource.UpdateAsync(WaitUntil.Completed, patch); + NewRelicMonitorResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -165,7 +167,7 @@ public async Task Update_MonitorsUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MonitorsDeleteMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Delete_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +177,7 @@ public async Task Delete_MonitorsDeleteMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -193,7 +195,7 @@ public async Task Delete_MonitorsDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MonitorsDeleteMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Delete_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,7 +205,7 @@ public async Task Delete_MonitorsDeleteMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -221,7 +223,7 @@ public async Task Delete_MonitorsDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricRules_MonitorsGetMetricRulesMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_GetMetricRules" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -231,7 +233,7 @@ public async Task GetMetricRules_MonitorsGetMetricRulesMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -249,7 +251,7 @@ public async Task GetMetricRules_MonitorsGetMetricRulesMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricRules_MonitorsGetMetricRulesMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_GetMetricRules" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -259,7 +261,7 @@ public async Task GetMetricRules_MonitorsGetMetricRulesMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -277,7 +279,7 @@ public async Task GetMetricRules_MonitorsGetMetricRulesMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricStatus_MonitorsGetMetricStatusMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_GetMetricStatus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +289,7 @@ public async Task GetMetricStatus_MonitorsGetMetricStatusMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -298,7 +300,7 @@ public async Task GetMetricStatus_MonitorsGetMetricStatusMaximumSetGen() { AzureResourceIds = { -"enfghpfw" +"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz" }, }; NewRelicMetricsStatusResult result = await newRelicMonitorResource.GetMetricStatusAsync(content); @@ -311,7 +313,7 @@ public async Task GetMetricStatus_MonitorsGetMetricStatusMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricStatus_MonitorsGetMetricStatusMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_GetMetricStatus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -321,14 +323,20 @@ public async Task GetMetricStatus_MonitorsGetMetricStatusMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); // invoke the operation - NewRelicMetricsStatusContent content = new NewRelicMetricsStatusContent("ruxvg@xqkmdhrnoo.hlmbpm"); + NewRelicMetricsStatusContent content = new NewRelicMetricsStatusContent("ruxvg@xqkmdhrnoo.hlmbpm") + { + AzureResourceIds = +{ +"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz" +}, + }; NewRelicMetricsStatusResult result = await newRelicMonitorResource.GetMetricStatusAsync(content); Console.WriteLine($"Succeeded: {result}"); @@ -339,7 +347,7 @@ public async Task GetMetricStatus_MonitorsGetMetricStatusMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAppServices_MonitorsListAppServicesMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_ListAppServices" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -349,7 +357,7 @@ public async Task GetAppServices_MonitorsListAppServicesMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -360,7 +368,7 @@ public async Task GetAppServices_MonitorsListAppServicesMaximumSetGen() { AzureResourceIds = { -new ResourceIdentifier("pvzrksrmzowobuhxpwiotnpcvjbu") +new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") }, }; await foreach (NewRelicObservabilityAppServiceInfo item in newRelicMonitorResource.GetAppServicesAsync(content)) @@ -376,7 +384,7 @@ public async Task GetAppServices_MonitorsListAppServicesMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAppServices_MonitorsListAppServicesMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_ListAppServices" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -386,14 +394,20 @@ public async Task GetAppServices_MonitorsListAppServicesMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); // invoke the operation and iterate over the result - NewRelicAppServicesGetContent content = new NewRelicAppServicesGetContent("ruxvg@xqkmdhrnoo.hlmbpm"); + NewRelicAppServicesGetContent content = new NewRelicAppServicesGetContent("ruxvg@xqkmdhrnoo.hlmbpm") + { + AzureResourceIds = +{ +new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") +}, + }; await foreach (NewRelicObservabilityAppServiceInfo item in newRelicMonitorResource.GetAppServicesAsync(content)) { Console.WriteLine($"Succeeded: {item}"); @@ -407,7 +421,7 @@ public async Task GetAppServices_MonitorsListAppServicesMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SwitchBilling_MonitorsSwitchBillingMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_SwitchBilling" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -417,7 +431,7 @@ public async Task SwitchBilling_MonitorsSwitchBillingMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -426,12 +440,12 @@ public async Task SwitchBilling_MonitorsSwitchBillingMaximumSetGen() // invoke the operation NewRelicSwitchBillingContent content = new NewRelicSwitchBillingContent("ruxvg@xqkmdhrnoo.hlmbpm") { - AzureResourceId = new ResourceIdentifier("enfghpfw"), + AzureResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz"), OrganizationId = "k", PlanData = new NewRelicPlanDetails() { UsageType = NewRelicObservabilityUsageType.Payg, - BillingCycle = NewRelicObservabilityBillingCycle.Yearly, + BillingCycle = "Yearly", PlanDetails = "tbbiaga", EffectiveOn = DateTimeOffset.Parse("2022-12-05T14:11:37.786Z"), }, @@ -450,7 +464,7 @@ public async Task SwitchBilling_MonitorsSwitchBillingMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SwitchBilling_MonitorsSwitchBillingMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_SwitchBilling" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -460,7 +474,7 @@ public async Task SwitchBilling_MonitorsSwitchBillingMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; string monitorName = "fhcjxnxumkdlgpwanewtkdnyuz"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -482,7 +496,7 @@ public async Task SwitchBilling_MonitorsSwitchBillingMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHosts_MonitorsListHostsMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListHosts_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_ListHosts" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -492,7 +506,7 @@ public async Task GetHosts_MonitorsListHostsMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -519,7 +533,7 @@ public async Task GetHosts_MonitorsListHostsMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHosts_MonitorsListHostsMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListHosts_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_ListHosts" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -529,7 +543,7 @@ public async Task GetHosts_MonitorsListHostsMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -556,7 +570,7 @@ public async Task GetHosts_MonitorsListHostsMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMonitoredResources_MonitorsListMonitoredResourcesMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_ListMonitoredResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -566,7 +580,7 @@ public async Task GetMonitoredResources_MonitorsListMonitoredResourcesMaximumSet // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -586,7 +600,7 @@ public async Task GetMonitoredResources_MonitorsListMonitoredResourcesMaximumSet [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMonitoredResources_MonitorsListMonitoredResourcesMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_ListMonitoredResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -596,7 +610,7 @@ public async Task GetMonitoredResources_MonitorsListMonitoredResourcesMinimumSet // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -611,12 +625,42 @@ public async Task GetMonitoredResources_MonitorsListMonitoredResourcesMinimumSet Console.WriteLine($"Succeeded"); } + // Monitors_ListLinkedResources + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetLinkedResources_MonitorsListLinkedResources() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/LinkedResources_List.json + // this example is just showing the usage of "Monitors_ListLinkedResources" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // invoke the operation and iterate over the result + await foreach (SubResource item in newRelicMonitorResource.GetLinkedResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + // Monitors_VmHostPayload_MaximumSet_Gen [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task VmHostPayload_MonitorsVmHostPayloadMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_VmHostPayload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -626,7 +670,7 @@ public async Task VmHostPayload_MonitorsVmHostPayloadMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -643,7 +687,7 @@ public async Task VmHostPayload_MonitorsVmHostPayloadMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task VmHostPayload_MonitorsVmHostPayloadMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json // this example is just showing the usage of "Monitors_VmHostPayload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -653,7 +697,7 @@ public async Task VmHostPayload_MonitorsVmHostPayloadMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -664,5 +708,62 @@ public async Task VmHostPayload_MonitorsVmHostPayloadMinimumSetGen() Console.WriteLine($"Succeeded: {result}"); } + + // BillingInfo_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetBillingInfo_BillingInfoGet() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/BillingInfo_Get.json + // this example is just showing the usage of "BillingInfo_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // invoke the operation + BillingInfoResult result = await newRelicMonitorResource.GetBillingInfoAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ConnectedPartnerResources_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetConnectedPartnerResources_ConnectedPartnerResourcesList() + { + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/ConnectedPartnerResources_List.json + // this example is just showing the usage of "ConnectedPartnerResources_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NewRelicMonitorResource created on azure + // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); + + // invoke the operation and iterate over the result + await foreach (ConnectedPartnerResourcesListFormat item in newRelicMonitorResource.GetConnectedPartnerResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs index 4dac08228be62..9acea1f0f8b47 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_NewRelicMonitorResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_MonitorsListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,7 +32,7 @@ public async Task GetAll_MonitorsListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -58,7 +58,7 @@ public async Task GetAll_MonitorsListByResourceGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MonitorsGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Get_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task Get_MonitorsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -92,7 +92,7 @@ public async Task Get_MonitorsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_MonitorsGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Get_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Exists_MonitorsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -122,7 +122,7 @@ public async Task Exists_MonitorsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_MonitorsGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_Get_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task GetIfExists_MonitorsGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -164,7 +164,7 @@ public async Task GetIfExists_MonitorsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_MonitorsCreateOrUpdateMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "Monitors_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task CreateOrUpdate_MonitorsCreateOrUpdateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgNewRelic"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -222,12 +222,14 @@ public async Task CreateOrUpdate_MonitorsCreateOrUpdateMaximumSetGen() PlanData = new NewRelicPlanDetails() { UsageType = NewRelicObservabilityUsageType.Payg, - BillingCycle = NewRelicObservabilityBillingCycle.Yearly, + BillingCycle = "Yearly", PlanDetails = "tbbiaga", EffectiveOn = DateTimeOffset.Parse("2022-12-05T14:11:37.786Z"), }, OrgCreationSource = NewRelicObservabilityOrgCreationSource.Liftr, AccountCreationSource = NewRelicObservabilityAccountCreationSource.Liftr, + SubscriptionState = "Suspended", + SaaSAzureSubscriptionStatus = "Subscribed", Tags = { ["key6976"] = "oaxfhf", diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleCollection.cs index 0fc0c4b9c3f0e..85873c625f659 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_NewRelicObservabilityTagRuleCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_TagRulesListByNewRelicMonitorResourceMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_ListByNewRelicMonitorResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task GetAll_TagRulesListByNewRelicMonitorResourceMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -57,7 +57,7 @@ public async Task GetAll_TagRulesListByNewRelicMonitorResourceMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_TagRulesListByNewRelicMonitorResourceMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_ListByNewRelicMonitorResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task GetAll_TagRulesListByNewRelicMonitorResourceMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -94,7 +94,7 @@ public async Task GetAll_TagRulesListByNewRelicMonitorResourceMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_TagRulesGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task Get_TagRulesGetMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -129,7 +129,7 @@ public async Task Get_TagRulesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_TagRulesGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +139,7 @@ public async Task Exists_TagRulesGetMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -160,7 +160,7 @@ public async Task Exists_TagRulesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_TagRulesGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_TagRulesGetMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -203,7 +203,7 @@ public async Task GetIfExists_TagRulesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_TagRulesGetMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task Get_TagRulesGetMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -238,7 +238,7 @@ public async Task Get_TagRulesGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_TagRulesGetMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -248,7 +248,7 @@ public async Task Exists_TagRulesGetMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -269,7 +269,7 @@ public async Task Exists_TagRulesGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_TagRulesGetMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -279,7 +279,7 @@ public async Task GetIfExists_TagRulesGetMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -312,7 +312,7 @@ public async Task GetIfExists_TagRulesGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_TagRulesCreateOrUpdateMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -322,7 +322,7 @@ public async Task CreateOrUpdate_TagRulesCreateOrUpdateMaximumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); @@ -379,7 +379,7 @@ public async Task CreateOrUpdate_TagRulesCreateOrUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_TagRulesCreateOrUpdateMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -389,7 +389,7 @@ public async Task CreateOrUpdate_TagRulesCreateOrUpdateMinimumSetGen() // this example assumes you already have this NewRelicMonitorResource created on azure // for more information of creating NewRelicMonitorResource, please refer to the document of NewRelicMonitorResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleResource.cs index f7f8a881a653c..8e149694d12b3 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicObservabilityTagRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NewRelicObservabilityTagRuleResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_TagRulesGetMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_TagRulesGetMaximumSetGen() // this example assumes you already have this NewRelicObservabilityTagRuleResource created on azure // for more information of creating NewRelicObservabilityTagRuleResource, please refer to the document of NewRelicObservabilityTagRuleResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; string ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; @@ -52,7 +52,7 @@ public async Task Get_TagRulesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_TagRulesGetMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Get_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task Get_TagRulesGetMinimumSetGen() // this example assumes you already have this NewRelicObservabilityTagRuleResource created on azure // for more information of creating NewRelicObservabilityTagRuleResource, please refer to the document of NewRelicObservabilityTagRuleResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; string ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; @@ -84,7 +84,7 @@ public async Task Get_TagRulesGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_TagRulesDeleteMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Delete_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Delete_TagRulesDeleteMaximumSetGen() // this example assumes you already have this NewRelicObservabilityTagRuleResource created on azure // for more information of creating NewRelicObservabilityTagRuleResource, please refer to the document of NewRelicObservabilityTagRuleResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; string ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; @@ -112,7 +112,7 @@ public async Task Delete_TagRulesDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_TagRulesDeleteMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Delete_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Delete_TagRulesDeleteMinimumSetGen() // this example assumes you already have this NewRelicObservabilityTagRuleResource created on azure // for more information of creating NewRelicObservabilityTagRuleResource, please refer to the document of NewRelicObservabilityTagRuleResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; string ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; @@ -140,7 +140,7 @@ public async Task Delete_TagRulesDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_TagRulesUpdateMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Update_MaximumSet_Gen.json // this example is just showing the usage of "TagRules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,7 +150,7 @@ public async Task Update_TagRulesUpdateMaximumSetGen() // this example assumes you already have this NewRelicObservabilityTagRuleResource created on azure // for more information of creating NewRelicObservabilityTagRuleResource, please refer to the document of NewRelicObservabilityTagRuleResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; string ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; @@ -203,7 +203,7 @@ public async Task Update_TagRulesUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_TagRulesUpdateMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/TagRules_Update_MinimumSet_Gen.json // this example is just showing the usage of "TagRules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task Update_TagRulesUpdateMinimumSetGen() // this example assumes you already have this NewRelicObservabilityTagRuleResource created on azure // for more information of creating NewRelicObservabilityTagRuleResource, please refer to the document of NewRelicObservabilityTagRuleResource - string subscriptionId = "ddqonpqwjr"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "rgopenapi"; string monitorName = "ipxmlcbonyxtolzejcjshkmlron"; string ruleSetName = "bxcantgzggsepbhqmedjqyrqeezmfb"; diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 807bbcf3312d7..6e078d0522801 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicAccounts_AccountsListMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Accounts_List_MaximumSet_Gen.json // this example is just showing the usage of "Accounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task GetNewRelicAccounts_AccountsListMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -51,7 +51,7 @@ public async Task GetNewRelicAccounts_AccountsListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicAccounts_AccountsListMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Accounts_List_MinimumSet_Gen.json // this example is just showing the usage of "Accounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetNewRelicAccounts_AccountsListMinimumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -81,7 +81,7 @@ public async Task GetNewRelicAccounts_AccountsListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicOrganizations_OrganizationsListMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Organizations_List_MaximumSet_Gen.json // this example is just showing the usage of "Organizations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task GetNewRelicOrganizations_OrganizationsListMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -111,7 +111,7 @@ public async Task GetNewRelicOrganizations_OrganizationsListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicOrganizations_OrganizationsListMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Organizations_List_MinimumSet_Gen.json // this example is just showing the usage of "Organizations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +121,7 @@ public async Task GetNewRelicOrganizations_OrganizationsListMinimumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -141,7 +141,7 @@ public async Task GetNewRelicOrganizations_OrganizationsListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicPlans_PlansListMaximumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Plans_List_MaximumSet_Gen.json // this example is just showing the usage of "Plans_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task GetNewRelicPlans_PlansListMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "hfmjmpyqgezxkp"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -171,7 +171,7 @@ public async Task GetNewRelicPlans_PlansListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNewRelicPlans_PlansListMinimumSetGen() { - // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json + // Generated from example definition: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-03-01/examples/Plans_List_MinimumSet_Gen.json // this example is just showing the usage of "Plans_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,12 +181,13 @@ public async Task GetNewRelicPlans_PlansListMinimumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "nqmcgifgaqlf"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (NewRelicPlanData item in subscriptionResource.GetNewRelicPlansAsync()) + string organizationId = "hilawwjz"; + await foreach (NewRelicPlanData item in subscriptionResource.GetNewRelicPlansAsync(organizationId: organizationId)) { Console.WriteLine($"Succeeded: {item}"); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs index 380c2fa907f0b..45a91eb10796e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -24,7 +25,7 @@ public static partial class ArmNewRelicObservabilityModelFactory /// organization id. /// account id. /// account name. - /// region. + /// Region where New Relic account is present. /// A new instance for mocking. public static NewRelicAccountResourceData NewRelicAccountResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string organizationId = null, string accountId = null, string accountName = null, AzureLocation? region = null) { @@ -59,8 +60,10 @@ public static NewRelicAccountResourceData NewRelicAccountResourceData(ResourceId /// Liftr resource preference. The priority of the resource. /// Source of org creation. /// Source of account creation. + /// State of the Azure Subscription containing the monitor resource. + /// Status of Azure Subscription where Marketplace SaaS is located. /// A new instance for mocking. - public static NewRelicMonitorResourceData NewRelicMonitorResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, NewRelicProvisioningState? provisioningState = null, NewRelicObservabilityMonitoringStatus? monitoringStatus = null, NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, string marketplaceSubscriptionId = null, NewRelicAccountProperties newRelicAccountProperties = null, NewRelicObservabilityUserInfo userInfo = null, NewRelicPlanDetails planData = null, NewRelicLiftrResourceCategory? liftrResourceCategory = null, int? liftrResourcePreference = null, NewRelicObservabilityOrgCreationSource? orgCreationSource = null, NewRelicObservabilityAccountCreationSource? accountCreationSource = null) + public static NewRelicMonitorResourceData NewRelicMonitorResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, NewRelicProvisioningState? provisioningState = null, NewRelicObservabilityMonitoringStatus? monitoringStatus = null, NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, string marketplaceSubscriptionId = null, NewRelicAccountProperties newRelicAccountProperties = null, NewRelicObservabilityUserInfo userInfo = null, NewRelicPlanDetails planData = null, NewRelicLiftrResourceCategory? liftrResourceCategory = null, int? liftrResourcePreference = null, NewRelicObservabilityOrgCreationSource? orgCreationSource = null, NewRelicObservabilityAccountCreationSource? accountCreationSource = null, string subscriptionState = null, string saaSAzureSubscriptionStatus = null) { tags ??= new Dictionary(); @@ -83,6 +86,8 @@ public static NewRelicMonitorResourceData NewRelicMonitorResourceData(ResourceId liftrResourcePreference, orgCreationSource, accountCreationSource, + subscriptionState, + saaSAzureSubscriptionStatus, serializedAdditionalRawData: null); } @@ -222,6 +227,61 @@ public static NewRelicResourceMonitorResult NewRelicResourceMonitorResult(Resour serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Marketplace Subscription details. + /// Partner Billing Entity details: Organization Info. + /// A new instance for mocking. + public static BillingInfoResult BillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo = null, PartnerBillingEntity partnerBillingEntity = null) + { + return new BillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Marketplace Subscription Id. This is a GUID-formatted string. + /// Marketplace Subscription Details: SAAS Name. + /// Marketplace Subscription Details: Resource URI. + /// Marketplace Subscription Details: SaaS Subscription Status. + /// The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + /// A new instance for mocking. + public static MarketplaceSaaSInfo MarketplaceSaaSInfo(string marketplaceSubscriptionId = null, string marketplaceSubscriptionName = null, string marketplaceResourceId = null, string marketplaceStatus = null, string billedAzureSubscriptionId = null) + { + return new MarketplaceSaaSInfo( + marketplaceSubscriptionId, + marketplaceSubscriptionName, + marketplaceResourceId, + marketplaceStatus, + billedAzureSubscriptionId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The New Relic Organization Id. + /// The New Relic Organization Name. + /// A new instance for mocking. + public static PartnerBillingEntity PartnerBillingEntity(string organizationId = null, string organizationName = null) + { + return new PartnerBillingEntity(organizationId, organizationName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Connected Partner Resource Properties. + /// A new instance for mocking. + public static ConnectedPartnerResourcesListFormat ConnectedPartnerResourcesListFormat(ConnectedPartnerResourceProperties properties = null) + { + return new ConnectedPartnerResourcesListFormat(properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// NewRelic account name. + /// NewRelic Account Id. + /// The azure resource Id of the deployment. + /// The location of the deployment. + /// A new instance for mocking. + public static ConnectedPartnerResourceProperties ConnectedPartnerResourceProperties(string accountName = null, string accountId = null, string azureResourceId = null, AzureLocation? location = null) + { + return new ConnectedPartnerResourceProperties(accountName, accountId, azureResourceId, location, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -244,6 +304,46 @@ public static NewRelicObservabilityTagRuleData NewRelicObservabilityTagRuleData( serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Provisioning State of the resource. + /// Set of rules for sending logs for the Monitor resource. + /// Set of rules for sending metrics for the Monitor resource. + /// A new instance for mocking. + public static MonitoringTagRulesProperties MonitoringTagRulesProperties(NewRelicProvisioningState? provisioningState = null, NewRelicObservabilityLogRules logRules = null, NewRelicObservabilityMetricRules metricRules = null) + { + return new MonitoringTagRulesProperties(provisioningState, logRules, metricRules, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + /// A new instance for mocking. + public static MonitoredSubscriptionPropertyData MonitoredSubscriptionPropertyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SubscriptionList properties = null) + { + return new MonitoredSubscriptionPropertyData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The operation for the patch on the resource. + /// List of subscriptions and the state of the monitoring. + /// Provisioning State of the resource. + /// A new instance for mocking. + public static SubscriptionList SubscriptionList(PatchOperation? patchOperation = null, IEnumerable monitoredSubscriptionList = null, NewRelicProvisioningState? provisioningState = null) + { + monitoredSubscriptionList ??= new List(); + + return new SubscriptionList(patchOperation, monitoredSubscriptionList?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Ingestion key of the account. /// A new instance for mocking. @@ -251,5 +351,31 @@ public static NewRelicObservabilityVmExtensionPayload NewRelicObservabilityVmExt { return new NewRelicObservabilityVmExtensionPayload(ingestionKey, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The managed service identities assigned to this resource. + /// Provisioning State of the resource. + /// MonitoringStatus of the resource. + /// NewRelic Organization properties of the resource. + /// Marketplace Subscription Id. + /// MarketplaceSubscriptionStatus of the resource. + /// User Info. + /// Plan details. + /// Liftr resource category. + /// Liftr resource preference. The priority of the resource. + /// Source of org creation. + /// Source of account creation. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static NewRelicMonitorResourceData NewRelicMonitorResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, NewRelicProvisioningState? provisioningState, NewRelicObservabilityMonitoringStatus? monitoringStatus, NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string marketplaceSubscriptionId, NewRelicAccountProperties newRelicAccountProperties, NewRelicObservabilityUserInfo userInfo, NewRelicPlanDetails planData, NewRelicLiftrResourceCategory? liftrResourceCategory, int? liftrResourcePreference, NewRelicObservabilityOrgCreationSource? orgCreationSource, NewRelicObservabilityAccountCreationSource? accountCreationSource) + { + return NewRelicMonitorResourceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, identity: identity, provisioningState: provisioningState, monitoringStatus: monitoringStatus, marketplaceSubscriptionStatus: marketplaceSubscriptionStatus, marketplaceSubscriptionId: marketplaceSubscriptionId, newRelicAccountProperties: newRelicAccountProperties, userInfo: userInfo, planData: planData, liftrResourceCategory: liftrResourceCategory, liftrResourcePreference: liftrResourcePreference, orgCreationSource: orgCreationSource, accountCreationSource: accountCreationSource, subscriptionState: default, saaSAzureSubscriptionStatus: default); + } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs index 96b84482638b3..a5d5bc453e01c 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs @@ -57,5 +57,17 @@ public virtual NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagR NewRelicObservabilityTagRuleResource.ValidateResourceId(id); return new NewRelicObservabilityTagRuleResource(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 MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(ResourceIdentifier id) + { + MonitoredSubscriptionPropertyResource.ValidateResourceId(id); + return new MonitoredSubscriptionPropertyResource(Client, id); + } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityResourceGroupResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityResourceGroupResource.cs index da01f72881340..bff2e5c1e4e79 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityResourceGroupResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual NewRelicMonitorResourceCollection GetNewRelicMonitorResources() /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetNewRelicMonitorR /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilitySubscriptionResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilitySubscriptionResource.cs index b04e49c4facdc..57f5087b7a1a5 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilitySubscriptionResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilitySubscriptionResource.cs @@ -66,7 +66,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -97,7 +97,7 @@ public virtual AsyncPageable GetNewRelicAccountsAsy /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -128,7 +128,7 @@ public virtual Pageable GetNewRelicAccounts(string /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -158,7 +158,7 @@ public virtual AsyncPageable GetNewRelicMonitorResource /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -188,7 +188,7 @@ public virtual Pageable GetNewRelicMonitorResources(Can /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -219,7 +219,7 @@ public virtual AsyncPageable GetNewRelicOrgani /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -250,7 +250,7 @@ public virtual Pageable GetNewRelicOrganizatio /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -278,7 +278,7 @@ public virtual AsyncPageable GetNewRelicPlansAsync(string acco /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs index a92286947c1d6..4b9f5a35448e5 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs @@ -71,6 +71,25 @@ public static NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagRu return GetMockableNewRelicObservabilityArmClient(client).GetNewRelicObservabilityTagRuleResource(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 MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNewRelicObservabilityArmClient(client).GetMonitoredSubscriptionPropertyResource(id); + } + /// /// Gets a collection of NewRelicMonitorResources in the ResourceGroupResource. /// @@ -101,7 +120,7 @@ public static NewRelicMonitorResourceCollection GetNewRelicMonitorResources(this /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -139,7 +158,7 @@ public static async Task> GetNewRelicMonitorRe /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -177,7 +196,7 @@ public static Response GetNewRelicMonitorResource(this /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -211,7 +230,7 @@ public static AsyncPageable GetNewRelicAccountsAsyn /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -245,7 +264,7 @@ public static Pageable GetNewRelicAccounts(this Sub /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -281,7 +300,7 @@ public static AsyncPageable GetNewRelicMonitorResources /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -317,7 +336,7 @@ public static Pageable GetNewRelicMonitorResources(this /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -351,7 +370,7 @@ public static AsyncPageable GetNewRelicOrganiz /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -385,7 +404,7 @@ public static Pageable GetNewRelicOrganization /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// @@ -419,7 +438,7 @@ public static AsyncPageable GetNewRelicPlansAsync(this Subscri /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs new file mode 100644 index 0000000000000..440b23068cb3c --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability +{ + internal class MonitoredSubscriptionPropertyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MonitoredSubscriptionPropertyOperationSource(ArmClient client) + { + _client = client; + } + + MonitoredSubscriptionPropertyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return new MonitoredSubscriptionPropertyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return new MonitoredSubscriptionPropertyResource(_client, data); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs new file mode 100644 index 0000000000000..593e1d7728889 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs @@ -0,0 +1,141 @@ +// 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.NewRelicObservability.Models +{ + public partial class BillingInfoResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingInfoResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(MarketplaceSaasInfo)) + { + writer.WritePropertyName("marketplaceSaasInfo"u8); + writer.WriteObjectValue(MarketplaceSaasInfo, options); + } + if (Optional.IsDefined(PartnerBillingEntity)) + { + writer.WritePropertyName("partnerBillingEntity"u8); + writer.WriteObjectValue(PartnerBillingEntity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BillingInfoResult 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(BillingInfoResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBillingInfoResult(document.RootElement, options); + } + + internal static BillingInfoResult DeserializeBillingInfoResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MarketplaceSaaSInfo marketplaceSaasInfo = default; + PartnerBillingEntity partnerBillingEntity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("marketplaceSaasInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceSaasInfo = MarketplaceSaaSInfo.DeserializeMarketplaceSaaSInfo(property.Value, options); + continue; + } + if (property.NameEquals("partnerBillingEntity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + partnerBillingEntity = PartnerBillingEntity.DeserializePartnerBillingEntity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, 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(BillingInfoResult)} does not support writing '{options.Format}' format."); + } + } + + BillingInfoResult 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); + return DeserializeBillingInfoResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BillingInfoResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs new file mode 100644 index 0000000000000..f654b0d3e7e13 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// Marketplace Subscription and Organization details to which resource gets billed into. + public partial class BillingInfoResult + { + /// + /// 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 BillingInfoResult() + { + } + + /// Initializes a new instance of . + /// Marketplace Subscription details. + /// Partner Billing Entity details: Organization Info. + /// Keeps track of any properties unknown to the library. + internal BillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo, PartnerBillingEntity partnerBillingEntity, IDictionary serializedAdditionalRawData) + { + MarketplaceSaasInfo = marketplaceSaasInfo; + PartnerBillingEntity = partnerBillingEntity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Marketplace Subscription details. + public MarketplaceSaaSInfo MarketplaceSaasInfo { get; } + /// Partner Billing Entity details: Organization Info. + public PartnerBillingEntity PartnerBillingEntity { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs new file mode 100644 index 0000000000000..48cfed1c7618e --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The ConfigurationName. + public readonly partial struct ConfigurationName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConfigurationName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "default"; + + /// default. + public static ConfigurationName Default { get; } = new ConfigurationName(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(ConfigurationName left, ConfigurationName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConfigurationName left, ConfigurationName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConfigurationName(string value) => new ConfigurationName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConfigurationName other && Equals(other); + /// + public bool Equals(ConfigurationName 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..e60793a75485d --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + public partial class ConnectedPartnerResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedPartnerResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AccountName)) + { + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + } + if (Optional.IsDefined(AccountId)) + { + writer.WritePropertyName("accountId"u8); + writer.WriteStringValue(AccountId); + } + if (Optional.IsDefined(AzureResourceId)) + { + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ConnectedPartnerResourceProperties 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(ConnectedPartnerResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedPartnerResourceProperties(document.RootElement, options); + } + + internal static ConnectedPartnerResourceProperties DeserializeConnectedPartnerResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accountName = default; + string accountId = default; + string azureResourceId = default; + AzureLocation? location = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountId"u8)) + { + accountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedPartnerResourceProperties(accountName, accountId, azureResourceId, location, 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(ConnectedPartnerResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectedPartnerResourceProperties 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); + return DeserializeConnectedPartnerResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedPartnerResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.cs new file mode 100644 index 0000000000000..a379cfa5948d0 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.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; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// Connected Partner Resource Properties. + public partial class ConnectedPartnerResourceProperties + { + /// + /// 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 ConnectedPartnerResourceProperties() + { + } + + /// Initializes a new instance of . + /// NewRelic account name. + /// NewRelic Account Id. + /// The azure resource Id of the deployment. + /// The location of the deployment. + /// Keeps track of any properties unknown to the library. + internal ConnectedPartnerResourceProperties(string accountName, string accountId, string azureResourceId, AzureLocation? location, IDictionary serializedAdditionalRawData) + { + AccountName = accountName; + AccountId = accountId; + AzureResourceId = azureResourceId; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// NewRelic account name. + public string AccountName { get; } + /// NewRelic Account Id. + public string AccountId { get; } + /// The azure resource Id of the deployment. + public string AzureResourceId { get; } + /// The location of the deployment. + public AzureLocation? Location { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs new file mode 100644 index 0000000000000..a18e42c4c0109 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs @@ -0,0 +1,126 @@ +// 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.NewRelicObservability.Models +{ + public partial class ConnectedPartnerResourcesListFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListFormat)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ConnectedPartnerResourcesListFormat 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(ConnectedPartnerResourcesListFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedPartnerResourcesListFormat(document.RootElement, options); + } + + internal static ConnectedPartnerResourcesListFormat DeserializeConnectedPartnerResourcesListFormat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectedPartnerResourceProperties properties = 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 = ConnectedPartnerResourceProperties.DeserializeConnectedPartnerResourceProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedPartnerResourcesListFormat(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(ConnectedPartnerResourcesListFormat)} does not support writing '{options.Format}' format."); + } + } + + ConnectedPartnerResourcesListFormat 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); + return DeserializeConnectedPartnerResourcesListFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.cs new file mode 100644 index 0000000000000..12e6a0d27a47d --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.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.NewRelicObservability.Models +{ + /// Connected Partner Resources List Format. + public partial class ConnectedPartnerResourcesListFormat + { + /// + /// 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 ConnectedPartnerResourcesListFormat() + { + } + + /// Initializes a new instance of . + /// Connected Partner Resource Properties. + /// Keeps track of any properties unknown to the library. + internal ConnectedPartnerResourcesListFormat(ConnectedPartnerResourceProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Connected Partner Resource Properties. + public ConnectedPartnerResourceProperties Properties { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs new file mode 100644 index 0000000000000..ac139feb07996 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + internal partial class ConnectedPartnerResourcesListResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ConnectedPartnerResourcesListResponse 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(ConnectedPartnerResourcesListResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedPartnerResourcesListResponse(document.RootElement, options); + } + + internal static ConnectedPartnerResourcesListResponse DeserializeConnectedPartnerResourcesListResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectedPartnerResourcesListFormat.DeserializeConnectedPartnerResourcesListFormat(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedPartnerResourcesListResponse(value ?? new ChangeTrackingList(), 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(ConnectedPartnerResourcesListResponse)} does not support writing '{options.Format}' format."); + } + } + + ConnectedPartnerResourcesListResponse 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); + return DeserializeConnectedPartnerResourcesListResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs new file mode 100644 index 0000000000000..e191c0580c2a2 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// List of all active newrelic deployments. + internal partial class ConnectedPartnerResourcesListResponse + { + /// + /// 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 ConnectedPartnerResourcesListResponse() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Results of a list operation. + /// Link to the next set of results, if any. + /// Keeps track of any properties unknown to the library. + internal ConnectedPartnerResourcesListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Results of a list operation. + public IReadOnlyList Value { get; } + /// Link to the next set of results, if any. + public string NextLink { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs new file mode 100644 index 0000000000000..cc7511005ff3c --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + internal partial class LinkedResourceListResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkedResourceListResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + LinkedResourceListResponse 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(LinkedResourceListResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkedResourceListResponse(document.RootElement, options); + } + + internal static LinkedResourceListResponse DeserializeLinkedResourceListResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkedResourceListResponse(value ?? new ChangeTrackingList(), 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(LinkedResourceListResponse)} does not support writing '{options.Format}' format."); + } + } + + LinkedResourceListResponse 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); + return DeserializeLinkedResourceListResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkedResourceListResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.cs new file mode 100644 index 0000000000000..0c73823cbae30 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// Response of a list operation. + internal partial class LinkedResourceListResponse + { + /// + /// 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 LinkedResourceListResponse() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Results of a list operation. + /// Link to the next set of results, if any. + /// Keeps track of any properties unknown to the library. + internal LinkedResourceListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Results of a list operation. + public IReadOnlyList Value { get; } + /// Link to the next set of results, if any. + public string NextLink { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs new file mode 100644 index 0000000000000..2986ed7cd4085 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs @@ -0,0 +1,172 @@ +// 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.NewRelicObservability.Models +{ + public partial class MarketplaceSaaSInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSaaSInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + if (Optional.IsDefined(MarketplaceSubscriptionName)) + { + writer.WritePropertyName("marketplaceSubscriptionName"u8); + writer.WriteStringValue(MarketplaceSubscriptionName); + } + if (Optional.IsDefined(MarketplaceResourceId)) + { + writer.WritePropertyName("marketplaceResourceId"u8); + writer.WriteStringValue(MarketplaceResourceId); + } + if (Optional.IsDefined(MarketplaceStatus)) + { + writer.WritePropertyName("marketplaceStatus"u8); + writer.WriteStringValue(MarketplaceStatus); + } + if (Optional.IsDefined(BilledAzureSubscriptionId)) + { + writer.WritePropertyName("billedAzureSubscriptionId"u8); + writer.WriteStringValue(BilledAzureSubscriptionId); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MarketplaceSaaSInfo 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(MarketplaceSaaSInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceSaaSInfo(document.RootElement, options); + } + + internal static MarketplaceSaaSInfo DeserializeMarketplaceSaaSInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string marketplaceSubscriptionId = default; + string marketplaceSubscriptionName = default; + string marketplaceResourceId = default; + string marketplaceStatus = default; + string billedAzureSubscriptionId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplaceSubscriptionName"u8)) + { + marketplaceSubscriptionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplaceResourceId"u8)) + { + marketplaceResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplaceStatus"u8)) + { + marketplaceStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("billedAzureSubscriptionId"u8)) + { + billedAzureSubscriptionId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceSaaSInfo( + marketplaceSubscriptionId, + marketplaceSubscriptionName, + marketplaceResourceId, + marketplaceStatus, + billedAzureSubscriptionId, + 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(MarketplaceSaaSInfo)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceSaaSInfo 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); + return DeserializeMarketplaceSaaSInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceSaaSInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs new file mode 100644 index 0000000000000..06bc4ecc96144 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// Marketplace SAAS Info of the resource. + public partial class MarketplaceSaaSInfo + { + /// + /// 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 MarketplaceSaaSInfo() + { + } + + /// Initializes a new instance of . + /// Marketplace Subscription Id. This is a GUID-formatted string. + /// Marketplace Subscription Details: SAAS Name. + /// Marketplace Subscription Details: Resource URI. + /// Marketplace Subscription Details: SaaS Subscription Status. + /// The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSaaSInfo(string marketplaceSubscriptionId, string marketplaceSubscriptionName, string marketplaceResourceId, string marketplaceStatus, string billedAzureSubscriptionId, IDictionary serializedAdditionalRawData) + { + MarketplaceSubscriptionId = marketplaceSubscriptionId; + MarketplaceSubscriptionName = marketplaceSubscriptionName; + MarketplaceResourceId = marketplaceResourceId; + MarketplaceStatus = marketplaceStatus; + BilledAzureSubscriptionId = billedAzureSubscriptionId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Marketplace Subscription Id. This is a GUID-formatted string. + public string MarketplaceSubscriptionId { get; } + /// Marketplace Subscription Details: SAAS Name. + public string MarketplaceSubscriptionName { get; } + /// Marketplace Subscription Details: Resource URI. + public string MarketplaceResourceId { get; } + /// Marketplace Subscription Details: SaaS Subscription Status. + public string MarketplaceStatus { get; } + /// The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + public string BilledAzureSubscriptionId { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs new file mode 100644 index 0000000000000..830eaa87a0f09 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs @@ -0,0 +1,163 @@ +// 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.NewRelicObservability.Models +{ + public partial class MonitoredSubscription : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoredSubscription)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(TagRules)) + { + writer.WritePropertyName("tagRules"u8); + writer.WriteObjectValue(TagRules, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitoredSubscription 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(MonitoredSubscription)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitoredSubscription(document.RootElement, options); + } + + internal static MonitoredSubscription DeserializeMonitoredSubscription(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subscriptionId = default; + Status? status = default; + string error = default; + MonitoringTagRulesProperties tagRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new Status(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("tagRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tagRules = MonitoringTagRulesProperties.DeserializeMonitoringTagRulesProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitoredSubscription(subscriptionId, status, error, tagRules, 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(MonitoredSubscription)} does not support writing '{options.Format}' format."); + } + } + + MonitoredSubscription 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); + return DeserializeMonitoredSubscription(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitoredSubscription)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs new file mode 100644 index 0000000000000..99750a428f305 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The list of subscriptions and it's monitoring status by current NewRelic monitor. + public partial class MonitoredSubscription + { + /// + /// 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 MonitoredSubscription() + { + } + + /// Initializes a new instance of . + /// The subscriptionId to be monitored. + /// The state of monitoring. + /// The reason of not monitoring the subscription. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal MonitoredSubscription(string subscriptionId, Status? status, string error, MonitoringTagRulesProperties tagRules, IDictionary serializedAdditionalRawData) + { + SubscriptionId = subscriptionId; + Status = status; + Error = error; + TagRules = tagRules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The subscriptionId to be monitored. + public string SubscriptionId { get; set; } + /// The state of monitoring. + public Status? Status { get; set; } + /// The reason of not monitoring the subscription. + public string Error { get; set; } + /// The resource-specific properties for this resource. + public MonitoringTagRulesProperties TagRules { get; set; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs new file mode 100644 index 0000000000000..74cd244858b43 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + internal partial class MonitoredSubscriptionPropertiesList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertiesList)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitoredSubscriptionPropertiesList 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(MonitoredSubscriptionPropertiesList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitoredSubscriptionPropertiesList(document.RootElement, options); + } + + internal static MonitoredSubscriptionPropertiesList DeserializeMonitoredSubscriptionPropertiesList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitoredSubscriptionPropertiesList(value ?? new ChangeTrackingList(), 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(MonitoredSubscriptionPropertiesList)} does not support writing '{options.Format}' format."); + } + } + + MonitoredSubscriptionPropertiesList 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); + return DeserializeMonitoredSubscriptionPropertiesList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertiesList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs new file mode 100644 index 0000000000000..bb2cd21b1bb8c --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The MonitoredSubscriptionPropertiesList. + internal partial class MonitoredSubscriptionPropertiesList + { + /// + /// 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 MonitoredSubscriptionPropertiesList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal MonitoredSubscriptionPropertiesList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the value. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public string NextLink { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs new file mode 100644 index 0000000000000..91e11c110ac3a --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs @@ -0,0 +1,156 @@ +// 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.NewRelicObservability.Models +{ + public partial class MonitoringTagRulesProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoringTagRulesProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(LogRules)) + { + writer.WritePropertyName("logRules"u8); + writer.WriteObjectValue(LogRules, options); + } + if (Optional.IsDefined(MetricRules)) + { + writer.WritePropertyName("metricRules"u8); + writer.WriteObjectValue(MetricRules, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitoringTagRulesProperties 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(MonitoringTagRulesProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitoringTagRulesProperties(document.RootElement, options); + } + + internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NewRelicProvisioningState? provisioningState = default; + NewRelicObservabilityLogRules logRules = default; + NewRelicObservabilityMetricRules metricRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NewRelicProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("logRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logRules = NewRelicObservabilityLogRules.DeserializeNewRelicObservabilityLogRules(property.Value, options); + continue; + } + if (property.NameEquals("metricRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metricRules = NewRelicObservabilityMetricRules.DeserializeNewRelicObservabilityMetricRules(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitoringTagRulesProperties(provisioningState, logRules, metricRules, 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(MonitoringTagRulesProperties)} does not support writing '{options.Format}' format."); + } + } + + MonitoringTagRulesProperties 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); + return DeserializeMonitoringTagRulesProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitoringTagRulesProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs new file mode 100644 index 0000000000000..fc200ffffe032 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The resource-specific properties for this resource. + public partial class MonitoringTagRulesProperties + { + /// + /// 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 MonitoringTagRulesProperties() + { + } + + /// Initializes a new instance of . + /// Provisioning State of the resource. + /// Set of rules for sending logs for the Monitor resource. + /// Set of rules for sending metrics for the Monitor resource. + /// Keeps track of any properties unknown to the library. + internal MonitoringTagRulesProperties(NewRelicProvisioningState? provisioningState, NewRelicObservabilityLogRules logRules, NewRelicObservabilityMetricRules metricRules, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + LogRules = logRules; + MetricRules = metricRules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Provisioning State of the resource. + public NewRelicProvisioningState? ProvisioningState { get; } + /// Set of rules for sending logs for the Monitor resource. + public NewRelicObservabilityLogRules LogRules { get; set; } + /// Set of rules for sending metrics for the Monitor resource. + public NewRelicObservabilityMetricRules MetricRules { get; set; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs index 6a037d40da818..55732d55467ef 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs @@ -60,7 +60,7 @@ public NewRelicAccountResourceData() /// organization id. /// account id. /// account name. - /// region. + /// Region where New Relic account is present. /// Keeps track of any properties unknown to the library. internal NewRelicAccountResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string organizationId, string accountId, string accountName, AzureLocation? region, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { @@ -77,7 +77,7 @@ internal NewRelicAccountResourceData(ResourceIdentifier id, string name, Resourc public string AccountId { get; set; } /// account name. public string AccountName { get; set; } - /// region. + /// Region where New Relic account is present. public AzureLocation? Region { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs index 42881614c06e1..f119907d32bb7 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs @@ -54,7 +54,7 @@ public NewRelicObservabilityAccountInfo() /// Initializes a new instance of . /// Account id. /// ingestion key of account. - /// NewRelic account region. + /// Region where New Relic account is present. /// Keeps track of any properties unknown to the library. internal NewRelicObservabilityAccountInfo(string accountId, string ingestionKey, AzureLocation? region, IDictionary serializedAdditionalRawData) { @@ -68,7 +68,7 @@ internal NewRelicObservabilityAccountInfo(string accountId, string ingestionKey, public string AccountId { get; set; } /// ingestion key of account. public string IngestionKey { get; set; } - /// NewRelic account region. + /// Region where New Relic account is present. public AzureLocation? Region { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs index aa83eb4fb5f5e..21089cf0c0a20 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs @@ -34,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(BillingCycle)) { writer.WritePropertyName("billingCycle"u8); - writer.WriteStringValue(BillingCycle.Value.ToString()); + writer.WriteStringValue(BillingCycle); } if (Optional.IsDefined(PlanDetails)) { @@ -85,7 +85,7 @@ internal static NewRelicPlanDetails DeserializeNewRelicPlanDetails(JsonElement e return null; } NewRelicObservabilityUsageType? usageType = default; - NewRelicObservabilityBillingCycle? billingCycle = default; + string billingCycle = default; string planDetails = default; DateTimeOffset? effectiveDate = default; IDictionary serializedAdditionalRawData = default; @@ -103,11 +103,7 @@ internal static NewRelicPlanDetails DeserializeNewRelicPlanDetails(JsonElement e } if (property.NameEquals("billingCycle"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - billingCycle = new NewRelicObservabilityBillingCycle(property.Value.GetString()); + billingCycle = property.Value.GetString(); continue; } if (property.NameEquals("planDetails"u8)) diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs index 24249858ed417..b0f2f08ee68a2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs @@ -52,11 +52,11 @@ public NewRelicPlanDetails() /// Initializes a new instance of . /// Different usage type like PAYG/COMMITTED. this could be enum. - /// Different billing cycles like MONTHLY/WEEKLY. this could be enum. + /// Different billing cycles like Monthly/Weekly. /// plan id as published by NewRelic. /// date when plan was applied. /// Keeps track of any properties unknown to the library. - internal NewRelicPlanDetails(NewRelicObservabilityUsageType? usageType, NewRelicObservabilityBillingCycle? billingCycle, string planDetails, DateTimeOffset? effectiveOn, IDictionary serializedAdditionalRawData) + internal NewRelicPlanDetails(NewRelicObservabilityUsageType? usageType, string billingCycle, string planDetails, DateTimeOffset? effectiveOn, IDictionary serializedAdditionalRawData) { UsageType = usageType; BillingCycle = billingCycle; @@ -67,8 +67,8 @@ internal NewRelicPlanDetails(NewRelicObservabilityUsageType? usageType, NewRelic /// Different usage type like PAYG/COMMITTED. this could be enum. public NewRelicObservabilityUsageType? UsageType { get; set; } - /// Different billing cycles like MONTHLY/WEEKLY. this could be enum. - public NewRelicObservabilityBillingCycle? BillingCycle { get; set; } + /// Different billing cycles like Monthly/Weekly. + public string BillingCycle { get; set; } /// plan id as published by NewRelic. public string PlanDetails { get; set; } /// date when plan was applied. diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs new file mode 100644 index 0000000000000..fcc2b29ef997c --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.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.NewRelicObservability.Models +{ + public partial class PartnerBillingEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PartnerBillingEntity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(OrganizationId)) + { + writer.WritePropertyName("organizationId"u8); + writer.WriteStringValue(OrganizationId); + } + if (Optional.IsDefined(OrganizationName)) + { + writer.WritePropertyName("organizationName"u8); + writer.WriteStringValue(OrganizationName); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PartnerBillingEntity 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(PartnerBillingEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePartnerBillingEntity(document.RootElement, options); + } + + internal static PartnerBillingEntity DeserializePartnerBillingEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string organizationId = default; + string organizationName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("organizationId"u8)) + { + organizationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("organizationName"u8)) + { + organizationName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PartnerBillingEntity(organizationId, organizationName, 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(PartnerBillingEntity)} does not support writing '{options.Format}' format."); + } + } + + PartnerBillingEntity 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); + return DeserializePartnerBillingEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PartnerBillingEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs new file mode 100644 index 0000000000000..7bc858f51af37 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// Partner Billing details associated with the resource. + public partial class PartnerBillingEntity + { + /// + /// 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 PartnerBillingEntity() + { + } + + /// Initializes a new instance of . + /// The New Relic Organization Id. + /// The New Relic Organization Name. + /// Keeps track of any properties unknown to the library. + internal PartnerBillingEntity(string organizationId, string organizationName, IDictionary serializedAdditionalRawData) + { + OrganizationId = organizationId; + OrganizationName = organizationName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The New Relic Organization Id. + public string OrganizationId { get; } + /// The New Relic Organization Name. + public string OrganizationName { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs new file mode 100644 index 0000000000000..330eef1b0a856 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The operation for the patch on the resource. + public readonly partial struct PatchOperation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchOperation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AddBeginValue = "AddBegin"; + private const string AddCompleteValue = "AddComplete"; + private const string DeleteBeginValue = "DeleteBegin"; + private const string DeleteCompleteValue = "DeleteComplete"; + private const string ActiveValue = "Active"; + + /// AddBegin. + public static PatchOperation AddBegin { get; } = new PatchOperation(AddBeginValue); + /// AddComplete. + public static PatchOperation AddComplete { get; } = new PatchOperation(AddCompleteValue); + /// DeleteBegin. + public static PatchOperation DeleteBegin { get; } = new PatchOperation(DeleteBeginValue); + /// DeleteComplete. + public static PatchOperation DeleteComplete { get; } = new PatchOperation(DeleteCompleteValue); + /// Active. + public static PatchOperation Active { get; } = new PatchOperation(ActiveValue); + /// Determines if two values are the same. + public static bool operator ==(PatchOperation left, PatchOperation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchOperation left, PatchOperation right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchOperation(string value) => new PatchOperation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchOperation other && Equals(other); + /// + public bool Equals(PatchOperation 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs new file mode 100644 index 0000000000000..337286c47be4d --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The state of monitoring. + public readonly partial struct Status : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Status(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InProgressValue = "InProgress"; + private const string ActiveValue = "Active"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + + /// InProgress. + public static Status InProgress { get; } = new Status(InProgressValue); + /// Active. + public static Status Active { get; } = new Status(ActiveValue); + /// Failed. + public static Status Failed { get; } = new Status(FailedValue); + /// Deleting. + public static Status Deleting { get; } = new Status(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(Status left, Status right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Status left, Status right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Status(string value) => new Status(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Status other && Equals(other); + /// + public bool Equals(Status 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs new file mode 100644 index 0000000000000..2c39a14343de4 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + public partial class SubscriptionList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriptionList)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchOperation)) + { + writer.WritePropertyName("patchOperation"u8); + writer.WriteStringValue(PatchOperation.Value.ToString()); + } + if (Optional.IsCollectionDefined(MonitoredSubscriptionList)) + { + writer.WritePropertyName("monitoredSubscriptionList"u8); + writer.WriteStartArray(); + foreach (var item in MonitoredSubscriptionList) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SubscriptionList 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(SubscriptionList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionList(document.RootElement, options); + } + + internal static SubscriptionList DeserializeSubscriptionList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PatchOperation? patchOperation = default; + IList monitoredSubscriptionList = default; + NewRelicProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchOperation = new PatchOperation(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoredSubscriptionList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitoredSubscription.DeserializeMonitoredSubscription(item, options)); + } + monitoredSubscriptionList = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NewRelicProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubscriptionList(patchOperation, monitoredSubscriptionList ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubscriptionList)} does not support writing '{options.Format}' format."); + } + } + + SubscriptionList 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); + return DeserializeSubscriptionList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubscriptionList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs new file mode 100644 index 0000000000000..e2294ad2b310c --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + public partial class SubscriptionList + { + /// + /// 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 SubscriptionList() + { + MonitoredSubscriptionList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The operation for the patch on the resource. + /// List of subscriptions and the state of the monitoring. + /// Provisioning State of the resource. + /// Keeps track of any properties unknown to the library. + internal SubscriptionList(PatchOperation? patchOperation, IList monitoredSubscriptionList, NewRelicProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + PatchOperation = patchOperation; + MonitoredSubscriptionList = monitoredSubscriptionList; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The operation for the patch on the resource. + public PatchOperation? PatchOperation { get; set; } + /// List of subscriptions and the state of the monitoring. + public IList MonitoredSubscriptionList { get; } + /// Provisioning State of the resource. + public NewRelicProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs new file mode 100644 index 0000000000000..8a27eb400bfc0 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + /// + /// 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 GetMonitoredSubscriptionProperties method from an instance of . + /// + public partial class MonitoredSubscriptionPropertyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics; + private readonly MonitoredSubscriptionsRestOperations _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MonitoredSubscriptionPropertyCollection() + { + } + + /// 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 MonitoredSubscriptionPropertyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", MonitoredSubscriptionPropertyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MonitoredSubscriptionPropertyResource.ResourceType, out string monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); + _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != NewRelicMonitorResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NewRelicMonitorResource.ResourceType), nameof(id)); + } + + /// + /// Add the subscriptions that should be monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-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 configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add the subscriptions that should be monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-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 configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken); + var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + public virtual async Task> GetAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Get"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + public virtual Response Get(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Get"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions + /// + /// + /// Operation Id + /// MonitoredSubscriptions_List + /// + /// + /// Default Api Version + /// 2024-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) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MonitoredSubscriptionPropertyResource(Client, MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(e)), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, "MonitoredSubscriptionPropertyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions + /// + /// + /// Operation Id + /// MonitoredSubscriptions_List + /// + /// + /// Default Api Version + /// 2024-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) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitoredSubscriptionPropertyResource(Client, MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(e)), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, "MonitoredSubscriptionPropertyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + public virtual async Task> ExistsAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Exists"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, 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/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + public virtual Response Exists(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Exists"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, 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/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + public virtual async Task> GetIfExistsAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(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/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + public virtual NullableResponse GetIfExists(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs new file mode 100644 index 0000000000000..dce2eeeacb7f7 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs @@ -0,0 +1,182 @@ +// 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.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + public partial class MonitoredSubscriptionPropertyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitoredSubscriptionPropertyData 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(MonitoredSubscriptionPropertyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitoredSubscriptionPropertyData(document.RootElement, options); + } + + internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscriptionPropertyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SubscriptionList 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 = SubscriptionList.DeserializeSubscriptionList(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 MonitoredSubscriptionPropertyData( + 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(MonitoredSubscriptionPropertyData)} does not support writing '{options.Format}' format."); + } + } + + MonitoredSubscriptionPropertyData 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); + return DeserializeMonitoredSubscriptionPropertyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.cs new file mode 100644 index 0000000000000..de4addd2098f5 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.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.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + /// + /// A class representing the MonitoredSubscriptionProperty data model. + /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + /// + public partial class MonitoredSubscriptionPropertyData : 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 MonitoredSubscriptionPropertyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + /// Keeps track of any properties unknown to the library. + internal MonitoredSubscriptionPropertyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubscriptionList properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + public SubscriptionList Properties { get; set; } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs new file mode 100644 index 0000000000000..21032c812268e --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.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.NewRelicObservability +{ + public partial class MonitoredSubscriptionPropertyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MonitoredSubscriptionPropertyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MonitoredSubscriptionPropertyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs new file mode 100644 index 0000000000000..986dc5b3e5fb4 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + /// + /// A Class representing a MonitoredSubscriptionProperty 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 GetMonitoredSubscriptionPropertyResource method. + /// Otherwise you can get one from its parent resource using the GetMonitoredSubscriptionProperty method. + /// + public partial class MonitoredSubscriptionPropertyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The monitorName. + /// The configurationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics; + private readonly MonitoredSubscriptionsRestOperations _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient; + private readonly MonitoredSubscriptionPropertyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "NewRelic.Observability/monitors/monitoredSubscriptions"; + + /// Initializes a new instance of the class for mocking. + protected MonitoredSubscriptionPropertyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MonitoredSubscriptionPropertyResource(ArmClient client, MonitoredSubscriptionPropertyData 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 MonitoredSubscriptionPropertyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); + _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); +#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 MonitoredSubscriptionPropertyData 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)); + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Get"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.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 MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Get"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-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 = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Delete"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2024-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 = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Delete"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new NewRelicObservabilityArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Update + /// + /// + /// Default Api Version + /// 2024-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 to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Update"); + scope.Start(); + try + { + var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Update + /// + /// + /// Default Api Version + /// 2024-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 to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Update"); + scope.Start(); + try + { + var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs index 83dee99ea3efe..eb87b57427075 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Autorest.CSharp.Core; @@ -15,6 +16,7 @@ using Azure.Core.Pipeline; using Azure.ResourceManager.NewRelicObservability.Models; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.NewRelicObservability { @@ -38,6 +40,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _newRelicMonitorResourceMonitorsClientDiagnostics; private readonly MonitorsRestOperations _newRelicMonitorResourceMonitorsRestClient; + private readonly ClientDiagnostics _billingInfoClientDiagnostics; + private readonly BillingInfoRestOperations _billingInfoRestClient; + private readonly ClientDiagnostics _connectedPartnerResourcesClientDiagnostics; + private readonly ConnectedPartnerResourcesRestOperations _connectedPartnerResourcesRestClient; private readonly NewRelicMonitorResourceData _data; /// Gets the resource type for the operations. @@ -65,6 +71,10 @@ internal NewRelicMonitorResource(ArmClient client, ResourceIdentifier id) : base _newRelicMonitorResourceMonitorsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string newRelicMonitorResourceMonitorsApiVersion); _newRelicMonitorResourceMonitorsRestClient = new MonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, newRelicMonitorResourceMonitorsApiVersion); + _billingInfoClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _billingInfoRestClient = new BillingInfoRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _connectedPartnerResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _connectedPartnerResourcesRestClient = new ConnectedPartnerResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -111,7 +121,7 @@ public virtual NewRelicObservabilityTagRuleCollection GetNewRelicObservabilityTa /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -142,7 +152,7 @@ public virtual async Task> GetNew /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -160,6 +170,71 @@ public virtual Response GetNewRelicObserva return GetNewRelicObservabilityTagRules().Get(ruleSetName, cancellationToken); } + /// Gets a collection of MonitoredSubscriptionPropertyResources in the NewRelicMonitorResource. + /// An object representing collection of MonitoredSubscriptionPropertyResources and their operations over a MonitoredSubscriptionPropertyResource. + public virtual MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionProperties() + { + return GetCachedClient(client => new MonitoredSubscriptionPropertyCollection(client, Id)); + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetMonitoredSubscriptionPropertyAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + return await GetMonitoredSubscriptionProperties().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetMonitoredSubscriptionProperty(ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + return GetMonitoredSubscriptionProperties().Get(configurationName, cancellationToken); + } + /// /// Get a NewRelicMonitorResource /// @@ -173,7 +248,7 @@ public virtual Response GetNewRelicObserva /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -213,7 +288,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -253,7 +328,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -299,7 +374,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -345,7 +420,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string userEmail, Cancel /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -365,7 +440,9 @@ public virtual async Task> UpdateAsync(NewReli try { var response = await _newRelicMonitorResourceMonitorsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new NewRelicMonitorResource(Client, response.Value), response.GetRawResponse()); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitorResourceOperationSource(Client), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, _newRelicMonitorResourceMonitorsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var finalResponse = await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return Response.FromValue(finalResponse.Value, finalResponse.GetRawResponse()); } catch (Exception e) { @@ -387,7 +464,7 @@ public virtual async Task> UpdateAsync(NewReli /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -395,10 +472,57 @@ public virtual async Task> UpdateAsync(NewReli /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual Response Update(NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _newRelicMonitorResourceMonitorsClientDiagnostics.CreateScope("NewRelicMonitorResource.Update"); + scope.Start(); + try + { + var response = await _newRelicMonitorResourceMonitorsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitorResourceOperationSource(Client), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, _newRelicMonitorResourceMonitorsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NewRelicMonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Update + /// + /// + /// Default Api Version + /// 2024-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -407,7 +531,10 @@ public virtual Response Update(NewRelicMonitorResourceP try { var response = _newRelicMonitorResourceMonitorsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new NewRelicMonitorResource(Client, response.Value), response.GetRawResponse()); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitorResourceOperationSource(Client), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, _newRelicMonitorResourceMonitorsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; } catch (Exception e) { @@ -429,7 +556,7 @@ public virtual Response Update(NewRelicMonitorResourceP /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -471,7 +598,7 @@ public virtual async Task> GetMetricR /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -513,7 +640,7 @@ public virtual Response GetMetricRules(NewReli /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -555,7 +682,7 @@ public virtual async Task> GetMetricStatus /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -597,7 +724,7 @@ public virtual Response GetMetricStatus(NewRelicMet /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -631,7 +758,7 @@ public virtual AsyncPageable GetAppServices /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -665,7 +792,7 @@ public virtual Pageable GetAppServices(NewR /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -707,7 +834,7 @@ public virtual async Task> SwitchBillingAsync( /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -749,7 +876,7 @@ public virtual Response SwitchBilling(NewRelicSwitchBil /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -783,7 +910,7 @@ public virtual AsyncPageable GetHostsAsync(NewRelic /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -817,7 +944,7 @@ public virtual Pageable GetHosts(NewRelicHostsGetCo /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -847,7 +974,7 @@ public virtual AsyncPageable GetMonitoredResource /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -864,6 +991,66 @@ public virtual Pageable GetMonitoredResources(Can return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NewRelicResourceMonitorResult.DeserializeNewRelicResourceMonitorResult(e), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetMonitoredResources", "value", "nextLink", cancellationToken); } + /// + /// List all Azure resources associated to the same NewRelic organization and account as the target resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources + /// + /// + /// Operation Id + /// Monitors_ListLinkedResources + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLinkedResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _newRelicMonitorResourceMonitorsRestClient.CreateListLinkedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _newRelicMonitorResourceMonitorsRestClient.CreateListLinkedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetLinkedResources", "value", "nextLink", cancellationToken); + } + + /// + /// List all Azure resources associated to the same NewRelic organization and account as the target resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources + /// + /// + /// Operation Id + /// Monitors_ListLinkedResources + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetLinkedResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _newRelicMonitorResourceMonitorsRestClient.CreateListLinkedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _newRelicMonitorResourceMonitorsRestClient.CreateListLinkedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetLinkedResources", "value", "nextLink", cancellationToken); + } + /// /// Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. /// @@ -877,7 +1064,7 @@ public virtual Pageable GetMonitoredResources(Can /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -915,7 +1102,7 @@ public virtual async Task> VmH /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -940,6 +1127,128 @@ public virtual Response VmHostPayload(C } } + /// + /// Get marketplace info mapped to the given monitor. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo + /// + /// + /// Operation Id + /// BillingInfo_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetBillingInfoAsync(CancellationToken cancellationToken = default) + { + using var scope = _billingInfoClientDiagnostics.CreateScope("NewRelicMonitorResource.GetBillingInfo"); + scope.Start(); + try + { + var response = await _billingInfoRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get marketplace info mapped to the given monitor. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo + /// + /// + /// Operation Id + /// BillingInfo_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetBillingInfo(CancellationToken cancellationToken = default) + { + using var scope = _billingInfoClientDiagnostics.CreateScope("NewRelicMonitorResource.GetBillingInfo"); + scope.Start(); + try + { + var response = _billingInfoRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources + /// + /// + /// Operation Id + /// ConnectedPartnerResources_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// + /// Email Id of the user. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetConnectedPartnerResourcesAsync(string body = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedPartnerResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedPartnerResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ConnectedPartnerResourcesListFormat.DeserializeConnectedPartnerResourcesListFormat(e), _connectedPartnerResourcesClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetConnectedPartnerResources", "value", "nextLink", cancellationToken); + } + + /// + /// List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources + /// + /// + /// Operation Id + /// ConnectedPartnerResources_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// + /// Email Id of the user. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetConnectedPartnerResources(string body = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedPartnerResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedPartnerResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ConnectedPartnerResourcesListFormat.DeserializeConnectedPartnerResourcesListFormat(e), _connectedPartnerResourcesClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetConnectedPartnerResources", "value", "nextLink", cancellationToken); + } + /// /// Add a tag to the current resource. /// @@ -953,7 +1262,7 @@ public virtual Response VmHostPayload(C /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -991,8 +1300,8 @@ public virtual async Task> AddTagAsync(string patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -1015,7 +1324,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -1053,8 +1362,8 @@ public virtual Response AddTag(string key, string value patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -1077,7 +1386,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -1110,8 +1419,8 @@ public virtual async Task> SetTagsAsync(IDicti var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; var patch = new NewRelicMonitorResourcePatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -1134,7 +1443,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -1167,8 +1476,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -1227,8 +1536,8 @@ public virtual async Task> RemoveTagAsync(stri patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -1251,7 +1560,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -1287,8 +1596,8 @@ public virtual Response RemoveTag(string key, Cancellat patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceCollection.cs index 6e7ea73bb5ece..30d259e778b19 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string mon /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string monitorName, Cancell /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string monitorName, Cancel /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string monitorName, CancellationToken cance /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs index c29fbfdcfc4ed..88e6dda81603b 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs @@ -123,6 +123,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("accountCreationSource"u8); writer.WriteStringValue(AccountCreationSource.Value.ToString()); } + if (Optional.IsDefined(SubscriptionState)) + { + writer.WritePropertyName("subscriptionState"u8); + writer.WriteStringValue(SubscriptionState); + } + if (Optional.IsDefined(SaaSAzureSubscriptionStatus)) + { + writer.WritePropertyName("saaSAzureSubscriptionStatus"u8); + writer.WriteStringValue(SaaSAzureSubscriptionStatus); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -180,6 +190,8 @@ internal static NewRelicMonitorResourceData DeserializeNewRelicMonitorResourceDa int? liftrResourcePreference = default; NewRelicObservabilityOrgCreationSource? orgCreationSource = default; NewRelicObservabilityAccountCreationSource? accountCreationSource = default; + string subscriptionState = default; + string saaSAzureSubscriptionStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -340,6 +352,16 @@ internal static NewRelicMonitorResourceData DeserializeNewRelicMonitorResourceDa accountCreationSource = new NewRelicObservabilityAccountCreationSource(property0.Value.GetString()); continue; } + if (property0.NameEquals("subscriptionState"u8)) + { + subscriptionState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("saaSAzureSubscriptionStatus"u8)) + { + saaSAzureSubscriptionStatus = property0.Value.GetString(); + continue; + } } continue; } @@ -368,6 +390,8 @@ internal static NewRelicMonitorResourceData DeserializeNewRelicMonitorResourceDa liftrResourcePreference, orgCreationSource, accountCreationSource, + subscriptionState, + saaSAzureSubscriptionStatus, serializedAdditionalRawData); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs index 4edd9c2ad0698..00377a86293a1 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs @@ -76,8 +76,10 @@ public NewRelicMonitorResourceData(AzureLocation location) : base(location) /// Liftr resource preference. The priority of the resource. /// Source of org creation. /// Source of account creation. + /// State of the Azure Subscription containing the monitor resource. + /// Status of Azure Subscription where Marketplace SaaS is located. /// Keeps track of any properties unknown to the library. - internal NewRelicMonitorResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, NewRelicProvisioningState? provisioningState, NewRelicObservabilityMonitoringStatus? monitoringStatus, NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string marketplaceSubscriptionId, NewRelicAccountProperties newRelicAccountProperties, NewRelicObservabilityUserInfo userInfo, NewRelicPlanDetails planData, NewRelicLiftrResourceCategory? liftrResourceCategory, int? liftrResourcePreference, NewRelicObservabilityOrgCreationSource? orgCreationSource, NewRelicObservabilityAccountCreationSource? accountCreationSource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal NewRelicMonitorResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, NewRelicProvisioningState? provisioningState, NewRelicObservabilityMonitoringStatus? monitoringStatus, NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string marketplaceSubscriptionId, NewRelicAccountProperties newRelicAccountProperties, NewRelicObservabilityUserInfo userInfo, NewRelicPlanDetails planData, NewRelicLiftrResourceCategory? liftrResourceCategory, int? liftrResourcePreference, NewRelicObservabilityOrgCreationSource? orgCreationSource, NewRelicObservabilityAccountCreationSource? accountCreationSource, string subscriptionState, string saaSAzureSubscriptionStatus, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; ProvisioningState = provisioningState; @@ -91,6 +93,8 @@ internal NewRelicMonitorResourceData(ResourceIdentifier id, string name, Resourc LiftrResourcePreference = liftrResourcePreference; OrgCreationSource = orgCreationSource; AccountCreationSource = accountCreationSource; + SubscriptionState = subscriptionState; + SaaSAzureSubscriptionStatus = saaSAzureSubscriptionStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -123,5 +127,9 @@ internal NewRelicMonitorResourceData() public NewRelicObservabilityOrgCreationSource? OrgCreationSource { get; set; } /// Source of account creation. public NewRelicObservabilityAccountCreationSource? AccountCreationSource { get; set; } + /// State of the Azure Subscription containing the monitor resource. + public string SubscriptionState { get; set; } + /// Status of Azure Subscription where Marketplace SaaS is located. + public string SaaSAzureSubscriptionStatus { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleCollection.cs index 272271232075f..ab9f05824e526 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string ruleSet /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string ruleSetName, Cancel /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string ruleSetName, CancellationToken cance /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleResource.cs index cd6ac9d1da9e4..bf72c29e9630a 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2022-07-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/AccountsRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/AccountsRestOperations.cs index d6ebe432c0b75..1ade40335f781 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/AccountsRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/AccountsRestOperations.cs @@ -32,7 +32,7 @@ public AccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs new file mode 100644 index 0000000000000..b631683b3cb0c --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs @@ -0,0 +1,133 @@ +// 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.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + internal partial class BillingInfoRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BillingInfoRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public BillingInfoRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/getBillingInfo", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName) + { + 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/getBillingInfo", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get marketplace info mapped to the given monitor. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BillingInfoResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BillingInfoResult.DeserializeBillingInfoResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get marketplace info mapped to the given monitor. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BillingInfoResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BillingInfoResult.DeserializeBillingInfoResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/ConnectedPartnerResourcesRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/ConnectedPartnerResourcesRestOperations.cs new file mode 100644 index 0000000000000..ffc1d771f44ec --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/ConnectedPartnerResourcesRestOperations.cs @@ -0,0 +1,228 @@ +// 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.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + internal partial class ConnectedPartnerResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectedPartnerResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectedPartnerResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listConnectedPartnerResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName, string body) + { + 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listConnectedPartnerResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStringValue(body); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// Email Id of the user. + /// 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 monitorName, string body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedPartnerResourcesListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectedPartnerResourcesListResponse.DeserializeConnectedPartnerResourcesListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// Email Id of the user. + /// 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 monitorName, string body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedPartnerResourcesListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectedPartnerResourcesListResponse.DeserializeConnectedPartnerResourcesListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, string body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, string body) + { + 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 of all active deployments that are associated with the marketplace subscription linked to the given monitor. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// Email Id of the user. + /// 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 monitorName, string body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedPartnerResourcesListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectedPartnerResourcesListResponse.DeserializeConnectedPartnerResourcesListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// Email Id of the user. + /// 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 monitorName, string body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedPartnerResourcesListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectedPartnerResourcesListResponse.DeserializeConnectedPartnerResourcesListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs new file mode 100644 index 0000000000000..fef287e713673 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs @@ -0,0 +1,605 @@ +// 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.NewRelicObservability.Models; + +namespace Azure.ResourceManager.NewRelicObservability +{ + internal partial class MonitoredSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MonitoredSubscriptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MonitoredSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName) + { + 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors 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 monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors 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 monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + { + 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), 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; + } + + /// Add the subscriptions that should be monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, 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); + } + } + + /// Add the subscriptions that should be monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), 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; + } + + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// The to use. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, configurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + { + 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the subscriptions that are being monitored by the NewRelic monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The configuration name. Only 'default' value is supported. + /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors 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 monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the subscriptions currently being monitored by the NewRelic monitor resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors 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 monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MonitoredSubscriptionPropertiesList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs index af72861390cf2..afc9f47db0e3c 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs @@ -32,7 +32,7 @@ public MonitorsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -434,7 +434,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -446,12 +446,8 @@ public async Task> UpdateAsync(string subs switch (message.Response.Status) { case 200: - { - NewRelicMonitorResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NewRelicMonitorResourceData.DeserializeNewRelicMonitorResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -465,7 +461,7 @@ public async Task> UpdateAsync(string subs /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string monitorName, NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string monitorName, NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -477,12 +473,8 @@ public Response Update(string subscriptionId, strin switch (message.Response.Status) { case 200: - { - NewRelicMonitorResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NewRelicMonitorResourceData.DeserializeNewRelicMonitorResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -1190,6 +1182,100 @@ public Response ListMonitoredR } } + internal RequestUriBuilder CreateListLinkedResourcesRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listLinkedResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListLinkedResourcesRequest(string subscriptionId, string resourceGroupName, string monitorName) + { + 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/NewRelic.Observability/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listLinkedResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all Azure resources associated to the same NewRelic organization and account as the target resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListLinkedResourcesAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListLinkedResourcesRequest(subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LinkedResourceListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all Azure resources associated to the same NewRelic organization and account as the target resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListLinkedResources(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListLinkedResourcesRequest(subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LinkedResourceListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateVmHostPayloadRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); @@ -1699,5 +1785,89 @@ public Response ListMonitoredR throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateListLinkedResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListLinkedResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + { + 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 all Azure resources associated to the same NewRelic organization and account as the target resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListLinkedResourcesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListLinkedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LinkedResourceListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all Azure resources associated to the same NewRelic organization and account as the target resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the Monitors resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListLinkedResourcesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateListLinkedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LinkedResourceListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/OrganizationsRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/OrganizationsRestOperations.cs index 75f9d31014be1..f8f749f82ad40 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/OrganizationsRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/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 ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/PlansRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/PlansRestOperations.cs index a6bd51eec7b8d..d554c8dccf395 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/PlansRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/PlansRestOperations.cs @@ -32,7 +32,7 @@ public PlansRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/TagRulesRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/TagRulesRestOperations.cs index baea4bdba3328..4e976677c7b70 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/TagRulesRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/TagRulesRestOperations.cs @@ -32,7 +32,7 @@ public TagRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md index dbeac93b49419..8aaf43233b1f8 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: Newrelic namespace: Azure.ResourceManager.NewRelicObservability -require: https://github.com/Azure/azure-rest-api-specs/blob/fd0b301360d7f83dee9dec5afe3fff77b90b79f6/specification/newrelic/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/07d286359f828bbc7901e86288a5d62b48ae2052/specification/newrelic/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -100,6 +100,7 @@ rename-mapping: AppServicesGetRequest.azureResourceIds: -|arm-id AppServiceInfo.azureResourceId: -|arm-id AppServicesListResponse: NewRelicAppServicesListResult + BillingInfoResponse: BillingInfoResult AzureStorageBlobContainerEndpointProperties: StorageBlobContainerEndpointProperties AzureStorageBlobContainerNewrelicEndpointProperties.StorageAccountResourceId: -|arm-id HostsGetRequest: NewRelicHostsGetContent From e39a3a1b9706e1de1c49e1f007fdae067092c99b Mon Sep 17 00:00:00 2001 From: VIPRAY JAIN Date: Thu, 4 Jul 2024 14:22:05 +0530 Subject: [PATCH 2/7] adding codeowners --- .github/CODEOWNERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a124b2e554c63..4c9008c7410ce 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -938,6 +938,13 @@ # ServiceLabel: %Astronomer %Mgmt # ServiceOwners: @banggaurav +# PRLabel: %NewRelicObservability +/sdk/astronomer/Azure.ResourceManager.NewRelicObservability/ @dipeshbhakat @vipray-ms + +# ServiceLabel: %NewRelicObservability %Mgmt +# ServiceOwners: @dipeshbhakat @vipray-ms + + # PRLabel: %Communication - Resource Manager /sdk/communication/Azure.ResourceManager.Communication/ @archerzz @ArcturusZhang @ArthurMa1978 From 76d421ea199eb8dc166df8b49f0a27ec7e40e035 Mon Sep 17 00:00:00 2001 From: VIPRAY JAIN Date: Thu, 4 Jul 2024 14:23:38 +0530 Subject: [PATCH 3/7] adding owners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4c9008c7410ce..c211d866a54ff 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -939,7 +939,7 @@ # ServiceOwners: @banggaurav # PRLabel: %NewRelicObservability -/sdk/astronomer/Azure.ResourceManager.NewRelicObservability/ @dipeshbhakat @vipray-ms +/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ @dipeshbhakat @vipray-ms # ServiceLabel: %NewRelicObservability %Mgmt # ServiceOwners: @dipeshbhakat @vipray-ms From 1309d79f5541ab780050e9c1321dba4358916b6d Mon Sep 17 00:00:00 2001 From: VIPRAY JAIN Date: Thu, 4 Jul 2024 14:28:05 +0530 Subject: [PATCH 4/7] adding dipesh as owner --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c211d866a54ff..8f2d107887417 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -939,10 +939,10 @@ # ServiceOwners: @banggaurav # PRLabel: %NewRelicObservability -/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ @dipeshbhakat @vipray-ms +/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ @dipeshbhakat-microsoft @vipray-ms # ServiceLabel: %NewRelicObservability %Mgmt -# ServiceOwners: @dipeshbhakat @vipray-ms +# ServiceOwners: @dipeshbhakat-microsoft @vipray-ms # PRLabel: %Communication - Resource Manager From 17c98910e09800366c048c4a67b43bdf0bbafc2c Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 5 Jul 2024 18:01:23 +0800 Subject: [PATCH 5/7] update --- .../CHANGELOG.md | 19 +- ...er.NewRelicObservability.netstandard2.0.cs | 376 +++++++++--------- .../Samples/Sample_NewRelicMonitorResource.cs | 8 +- ...ample_NewRelicMonitorResourceCollection.cs | 2 +- ...ewRelicMonitoredSubscriptionCollection.cs} | 52 +-- ..._NewRelicMonitoredSubscriptionResource.cs} | 46 +-- ...sourceManager.NewRelicObservability.csproj | 2 +- .../NewRelicObservabilityBillingCycle.cs | 2 - .../src/Custom/Models/NewRelicPlanDetails.cs | 18 + .../src/Custom/NewRelicMonitorResource.cs | 87 ++++ .../ArmNewRelicObservabilityModelFactory.cs | 50 +-- .../MockableNewRelicObservabilityArmClient.cs | 12 +- .../NewRelicObservabilityExtensions.cs | 12 +- .../Internal/BicepSerializationHelpers.cs | 58 +++ .../Generated/Internal/WirePathAttribute.cs | 27 ++ ...oredSubscriptionPropertyOperationSource.cs | 38 -- ...licMonitoredSubscriptionOperationSource.cs | 38 ++ .../src/Generated/Models/ConfigurationName.cs | 48 --- ...PartnerResourceProperties.Serialization.cs | 159 -------- ...artnerResourcesListFormat.Serialization.cs | 126 ------ ...tnerResourcesListResponse.Serialization.cs | 73 +++- .../ConnectedPartnerResourcesListResponse.cs | 6 +- ...inkedResourceListResponse.Serialization.cs | 65 +++ .../MarketplaceSaaSInfo.Serialization.cs | 133 +++++++ .../Generated/Models/MarketplaceSaaSInfo.cs | 5 + .../MonitoredSubscription.Serialization.cs | 163 -------- .../MonitoredSubscriptionConfigurationName.cs | 48 +++ .../MonitoredSubscriptionPatchOperation.cs | 60 +++ ...ubscriptionPropertiesList.Serialization.cs | 73 +++- .../MonitoredSubscriptionPropertiesList.cs | 6 +- ...NewRelicAccountProperties.Serialization.cs | 89 +++++ .../Models/NewRelicAccountProperties.cs | 4 + ...wRelicAccountResourceData.Serialization.cs | 158 ++++++++ .../Models/NewRelicAccountResourceData.cs | 4 + ...ewRelicAccountsListResult.Serialization.cs | 57 +++ .../Models/NewRelicAppServicesGetContent.cs | 2 + ...elicAppServicesListResult.Serialization.cs | 57 +++ ...ewRelicBillingInfoResult.Serialization.cs} | 86 +++- ...Result.cs => NewRelicBillingInfoResult.cs} | 12 +- ...nectedPartnerResourceInfo.Serialization.cs | 159 ++++++++ ...> NewRelicConnectedPartnerResourceInfo.cs} | 13 +- ...PartnerResourceProperties.Serialization.cs | 261 ++++++++++++ ...elicConnectedPartnerResourceProperties.cs} | 14 +- .../Models/NewRelicHostsGetContent.cs | 2 + .../Models/NewRelicMetricsContent.cs | 1 + .../Models/NewRelicMetricsStatusContent.cs | 2 + ...wRelicMetricsStatusResult.Serialization.cs | 55 +++ .../Models/NewRelicMetricsStatusResult.cs | 1 + ...MonitorResourceListResult.Serialization.cs | 57 +++ .../Models/NewRelicMonitorResourcePatch.cs | 7 + ...nitoredResourceListResult.Serialization.cs | 201 ++++++++++ ...=> NewRelicMonitoredResourceListResult.cs} | 14 +- ...MonitoredSubscriptionInfo.Serialization.cs | 257 ++++++++++++ ...s => NewRelicMonitoredSubscriptionInfo.cs} | 18 +- ...redSubscriptionProperties.Serialization.cs | 238 +++++++++++ ...ewRelicMonitoredSubscriptionProperties.cs} | 19 +- .../Models/NewRelicMonitoringStatus.cs | 57 +++ ...wRelicMonitoringTagRules.Serialization.cs} | 101 ++++- ...rties.cs => NewRelicMonitoringTagRules.cs} | 13 +- ...cObservabilityAccountInfo.Serialization.cs | 79 ++++ .../NewRelicObservabilityAccountInfo.cs | 3 + ...servabilityAppServiceInfo.Serialization.cs | 79 ++++ .../NewRelicObservabilityAppServiceInfo.cs | 3 + ...ObservabilityFilteringTag.Serialization.cs | 79 ++++ .../NewRelicObservabilityFilteringTag.cs | 3 + ...elicObservabilityLogRules.Serialization.cs | 87 ++++ .../Models/NewRelicObservabilityLogRules.cs | 4 + ...cObservabilityMetricRules.Serialization.cs | 80 ++++ .../NewRelicObservabilityMetricRules.cs | 3 + ...nitoredResourceListResult.Serialization.cs | 144 ------- ...rvabilityOrganizationInfo.Serialization.cs | 41 ++ .../NewRelicObservabilityOrganizationInfo.cs | 1 + ...vabilityTagRuleListResult.Serialization.cs | 57 +++ .../NewRelicObservabilityTagRulePatch.cs | 2 + ...elicObservabilityUserInfo.Serialization.cs | 133 +++++++ .../Models/NewRelicObservabilityUserInfo.cs | 5 + ...abilityVmExtensionPayload.Serialization.cs | 41 ++ ...NewRelicObservabilityVmExtensionPayload.cs | 1 + ...bilityVmHostsListResponse.Serialization.cs | 57 +++ ...wRelicObservabilityVmInfo.Serialization.cs | 79 ++++ .../Models/NewRelicObservabilityVmInfo.cs | 3 + ...cOrganizationResourceData.Serialization.cs | 135 +++++++ .../NewRelicOrganizationResourceData.cs | 3 + ...icOrganizationsListResult.Serialization.cs | 57 +++ .../Models/NewRelicPlanData.Serialization.cs | 119 ++++++ .../src/Generated/Models/NewRelicPlanData.cs | 3 + ...ewRelicPlanDataListResult.Serialization.cs | 57 +++ .../NewRelicPlanDetails.Serialization.cs | 99 ++++- .../Generated/Models/NewRelicPlanDetails.cs | 12 +- ...elicResourceMonitorResult.Serialization.cs | 109 +++++ .../Models/NewRelicResourceMonitorResult.cs | 5 + ...licSingleSignOnProperties.Serialization.cs | 86 ++++ .../Models/NewRelicSingleSignOnProperties.cs | 4 + .../Models/NewRelicSwitchBillingContent.cs | 4 + .../PartnerBillingEntity.Serialization.cs | 64 +++ .../Generated/Models/PartnerBillingEntity.cs | 2 + .../src/Generated/Models/PatchOperation.cs | 60 --- .../src/Generated/Models/Status.cs | 57 --- .../Models/SubscriptionList.Serialization.cs | 166 -------- ...scriptionPropertyResource.Serialization.cs | 26 -- .../src/Generated/NewRelicMonitorResource.cs | 80 +--- ...wRelicMonitorResourceData.Serialization.cs | 358 +++++++++++++++++ .../Generated/NewRelicMonitorResourceData.cs | 14 + ...ewRelicMonitoredSubscriptionCollection.cs} | 138 +++---- ...onitoredSubscriptionData.Serialization.cs} | 128 +++++- ...s => NewRelicMonitoredSubscriptionData.cs} | 15 +- ...toredSubscriptionResource.Serialization.cs | 26 ++ ... NewRelicMonitoredSubscriptionResource.cs} | 100 ++--- ...cObservabilityTagRuleData.Serialization.cs | 119 ++++++ .../NewRelicObservabilityTagRuleData.cs | 3 + .../BillingInfoRestOperations.cs | 12 +- .../MonitoredSubscriptionsRestOperations.cs | 52 +-- .../RestOperations/MonitorsRestOperations.cs | 24 +- .../src/autorest.md | 20 +- 114 files changed, 5287 insertions(+), 1625 deletions(-) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/{Sample_MonitoredSubscriptionPropertyCollection.cs => Sample_NewRelicMonitoredSubscriptionCollection.cs} (82%) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/{Sample_MonitoredSubscriptionPropertyResource.cs => Sample_NewRelicMonitoredSubscriptionResource.cs} (63%) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/{Generated => Custom}/Models/NewRelicObservabilityBillingCycle.cs (99%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicPlanDetails.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/NewRelicMonitorResource.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/BicepSerializationHelpers.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/WirePathAttribute.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/NewRelicMonitoredSubscriptionOperationSource.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionConfigurationName.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPatchOperation.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{BillingInfoResult.Serialization.cs => NewRelicBillingInfoResult.Serialization.cs} (50%) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{BillingInfoResult.cs => NewRelicBillingInfoResult.cs} (81%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{ConnectedPartnerResourcesListFormat.cs => NewRelicConnectedPartnerResourceInfo.cs} (77%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{ConnectedPartnerResourceProperties.cs => NewRelicConnectedPartnerResourceProperties.cs} (79%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{NewRelicObservabilityMonitoredResourceListResult.cs => NewRelicMonitoredResourceListResult.cs} (81%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{MonitoredSubscription.cs => NewRelicMonitoredSubscriptionInfo.cs} (77%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{SubscriptionList.cs => NewRelicMonitoredSubscriptionProperties.cs} (72%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringStatus.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{MonitoringTagRulesProperties.Serialization.cs => NewRelicMonitoringTagRules.Serialization.cs} (50%) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/{MonitoringTagRulesProperties.cs => NewRelicMonitoringTagRules.cs} (81%) delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.Serialization.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/{MonitoredSubscriptionPropertyCollection.cs => NewRelicMonitoredSubscriptionCollection.cs} (66%) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/{MonitoredSubscriptionPropertyData.Serialization.cs => NewRelicMonitoredSubscriptionData.Serialization.cs} (53%) rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/{MonitoredSubscriptionPropertyData.cs => NewRelicMonitoredSubscriptionData.cs} (78%) create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.Serialization.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/{MonitoredSubscriptionPropertyResource.cs => NewRelicMonitoredSubscriptionResource.cs} (73%) diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md index 8104b482ed428..6523e075d15e0 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md @@ -1,22 +1,23 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0 (2024-07-05) ### Features Added -- Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. - -### Breaking Changes - -### Bugs Fixed +- Upgraded api-version tag from 'package-2022-07-01' to 'package-2024-03-01'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/07d286359f828bbc7901e86288a5d62b48ae2052/specification/newrelic/resource-manager/readme.md. +- Added `ArmOperation.Rehydrate` and `ArmOperation.Rehydrate` static methods to rehydrate a long-running operation. +- Enabled the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. ### Other Changes +- Upgraded Azure.Core from 1.36.0 to 1.40.0 +- Upgraded Azure.ResourceManager from 1.9.0 to 1.12.0 + ## 1.0.1 (2023-11-29) ### Features Added -- Enable mocking for extension methods, refer this [document](https://aka.ms/azsdk/net/mocking) for more details. +- Enabled mocking for extension methods, refer this [document](https://aka.ms/azsdk/net/mocking) for more details. ### Other Changes @@ -40,7 +41,7 @@ Polishing since last public beta release: ### Features Added -- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). +- Enabled the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes @@ -61,4 +62,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs index 770ef1de21fc1..74eec33803e7e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/api/Azure.ResourceManager.NewRelicObservability.netstandard2.0.cs @@ -1,50 +1,50 @@ namespace Azure.ResourceManager.NewRelicObservability { - public partial class MonitoredSubscriptionPropertyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected MonitoredSubscriptionPropertyCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, 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(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, 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; } + public partial class NewRelicMonitoredSubscriptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NewRelicMonitoredSubscriptionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, 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(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, 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 MonitoredSubscriptionPropertyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class NewRelicMonitoredSubscriptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MonitoredSubscriptionPropertyData() { } - public Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList Properties { get { throw null; } set { } } - Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public NewRelicMonitoredSubscriptionData() { } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MonitoredSubscriptionPropertyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class NewRelicMonitoredSubscriptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected MonitoredSubscriptionPropertyResource() { } - public virtual Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData Data { get { throw null; } } + protected NewRelicMonitoredSubscriptionResource() { } + public virtual Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.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.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.NewRelicObservability.NewRelicMonitoredSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NewRelicMonitorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -61,10 +61,10 @@ protected NewRelicMonitorResource() { } public virtual Azure.Pageable GetAppServices(Azure.ResourceManager.NewRelicObservability.Models.NewRelicAppServicesGetContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAppServicesAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicAppServicesGetContent content, 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 GetBillingInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetBillingInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetConnectedPartnerResources(string body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetConnectedPartnerResourcesAsync(string body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBillingInfo(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBillingInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetConnectedPartnerResources(string body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConnectedPartnerResourcesAsync(string body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHosts(Azure.ResourceManager.NewRelicObservability.Models.NewRelicHostsGetContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHostsAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicHostsGetContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetLinkedResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -75,9 +75,9 @@ protected NewRelicMonitorResource() { } public virtual System.Threading.Tasks.Task> GetMetricStatusAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetMonitoredResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetMonitoredResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionProperties() { throw null; } - public virtual Azure.Response GetMonitoredSubscriptionProperty(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetMonitoredSubscriptionPropertyAsync(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetNewRelicMonitoredSubscription(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNewRelicMonitoredSubscriptionAsync(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionCollection GetNewRelicMonitoredSubscriptions() { throw null; } public virtual Azure.Response GetNewRelicObservabilityTagRule(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNewRelicObservabilityTagRuleAsync(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.NewRelicObservability.NewRelicObservabilityTagRuleCollection GetNewRelicObservabilityTagRules() { throw null; } @@ -92,7 +92,9 @@ protected NewRelicMonitorResource() { } Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response VmHostPayload(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> VmHostPayloadAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -139,9 +141,9 @@ public NewRelicMonitorResourceData(Azure.Core.AzureLocation location) { } } public static partial class NewRelicObservabilityExtensions { - public static Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetNewRelicAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string userEmail, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNewRelicAccountsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string userEmail, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionResource GetNewRelicMonitoredSubscriptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResource GetNewRelicMonitorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetNewRelicMonitorResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string monitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetNewRelicMonitorResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string monitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -208,7 +210,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Mocking public partial class MockableNewRelicObservabilityArmClient : Azure.ResourceManager.ArmResource { protected MockableNewRelicObservabilityArmClient() { } - public virtual Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionResource GetNewRelicMonitoredSubscriptionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResource GetNewRelicMonitorResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NewRelicObservability.NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -236,17 +238,18 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { public static partial class ArmNewRelicObservabilityModelFactory { - public static Azure.ResourceManager.NewRelicObservability.Models.BillingInfoResult BillingInfoResult(Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo marketplaceSaasInfo = null, Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity partnerBillingEntity = null) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties ConnectedPartnerResourceProperties(string accountName = null, string accountId = null, string azureResourceId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourcesListFormat ConnectedPartnerResourcesListFormat(Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo MarketplaceSaaSInfo(string marketplaceSubscriptionId = null, string marketplaceSubscriptionName = null, string marketplaceResourceId = null, string marketplaceStatus = null, string billedAzureSubscriptionId = null) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.MonitoredSubscriptionPropertyData MonitoredSubscriptionPropertyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList properties = null) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties MonitoringTagRulesProperties(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules logRules = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules metricRules = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountResourceData NewRelicAccountResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string organizationId = null, string accountId = null, string accountName = null, Azure.Core.AzureLocation? region = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicAppServicesGetContent NewRelicAppServicesGetContent(System.Collections.Generic.IEnumerable azureResourceIds = null, string userEmail = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicBillingInfoResult NewRelicBillingInfoResult(Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo marketplaceSaasInfo = null, Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity partnerBillingEntity = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceInfo NewRelicConnectedPartnerResourceInfo(Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceProperties NewRelicConnectedPartnerResourceProperties(string accountName = null, string accountId = null, string azureResourceId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicHostsGetContent NewRelicHostsGetContent(System.Collections.Generic.IEnumerable vmIds = null, string userEmail = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusContent NewRelicMetricsStatusContent(System.Collections.Generic.IEnumerable azureResourceIds = null, string userEmail = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMetricsStatusResult NewRelicMetricsStatusResult(System.Collections.Generic.IEnumerable azureResourceIds = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitoredSubscriptionData NewRelicMonitoredSubscriptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionProperties properties = null) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionProperties NewRelicMonitoredSubscriptionProperties(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation? patchOperation = default(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation?), System.Collections.Generic.IEnumerable monitoredSubscriptionList = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?)) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringTagRules NewRelicMonitoringTagRules(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules logRules = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules metricRules = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData NewRelicMonitorResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus? monitoringStatus, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string marketplaceSubscriptionId, Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountProperties newRelicAccountProperties, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUserInfo userInfo, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData, Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory? liftrResourceCategory, int? liftrResourcePreference, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? orgCreationSource, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource? accountCreationSource) { throw null; } public static Azure.ResourceManager.NewRelicObservability.NewRelicMonitorResourceData NewRelicMonitorResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus? monitoringStatus = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMonitoringStatus?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMarketplaceSubscriptionStatus?), string marketplaceSubscriptionId = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicAccountProperties newRelicAccountProperties = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUserInfo userInfo = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory? liftrResourceCategory = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicLiftrResourceCategory?), int? liftrResourcePreference = default(int?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource? orgCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityOrgCreationSource?), Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource? accountCreationSource = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityAccountCreationSource?), string subscriptionState = null, string saaSAzureSubscriptionStatus = null) { throw null; } @@ -259,58 +262,6 @@ public static partial class ArmNewRelicObservabilityModelFactory public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicResourceMonitorResult NewRelicResourceMonitorResult(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingMetricsStatus? sendingMetrics = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingMetricsStatus?), string reasonForMetricsStatus = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingLogsStatus? sendingLogs = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilitySendingLogsStatus?), string reasonForLogsStatus = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicSwitchBillingContent NewRelicSwitchBillingContent(Azure.Core.ResourceIdentifier azureResourceId = null, string organizationId = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails planData = null, string userEmail = null) { throw null; } public static Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity PartnerBillingEntity(string organizationId = null, string organizationName = null) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList SubscriptionList(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation? patchOperation = default(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation?), System.Collections.Generic.IEnumerable monitoredSubscriptionList = null, Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? provisioningState = default(Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState?)) { throw null; } - } - public partial class BillingInfoResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal BillingInfoResult() { } - public Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo MarketplaceSaasInfo { get { throw null; } } - public Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity PartnerBillingEntity { get { throw null; } } - Azure.ResourceManager.NewRelicObservability.Models.BillingInfoResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.Models.BillingInfoResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.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 ConfigurationName : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ConfigurationName(string value) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName Default { get { throw null; } } - public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName 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.NewRelicObservability.Models.ConfigurationName left, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName right) { throw null; } - public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName left, Azure.ResourceManager.NewRelicObservability.Models.ConfigurationName right) { throw null; } - public override string ToString() { throw null; } - } - public partial class ConnectedPartnerResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ConnectedPartnerResourceProperties() { } - public string AccountId { get { throw null; } } - public string AccountName { get { throw null; } } - public string AzureResourceId { get { throw null; } } - public Azure.Core.AzureLocation? Location { get { throw null; } } - Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ConnectedPartnerResourcesListFormat : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ConnectedPartnerResourcesListFormat() { } - public Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourceProperties Properties { get { throw null; } } - Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourcesListFormat System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.Models.ConnectedPartnerResourcesListFormat System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class MarketplaceSaaSInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -326,30 +277,43 @@ internal MarketplaceSaaSInfo() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MonitoredSubscription : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MonitoredSubscriptionConfigurationName : System.IEquatable { - public MonitoredSubscription() { } - public string Error { get { throw null; } set { } } - public Azure.ResourceManager.NewRelicObservability.Models.Status? Status { get { throw null; } set { } } - public string SubscriptionId { get { throw null; } set { } } - public Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties TagRules { get { throw null; } set { } } - Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscription System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscription System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MonitoredSubscriptionConfigurationName(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName Default { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName 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.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName left, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName left, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionConfigurationName right) { throw null; } + public override string ToString() { throw null; } } - public partial class MonitoringTagRulesProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MonitoredSubscriptionPatchOperation : System.IEquatable { - public MonitoringTagRulesProperties() { } - public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules LogRules { get { throw null; } set { } } - public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules MetricRules { get { throw null; } set { } } - public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } - Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.Models.MonitoringTagRulesProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MonitoredSubscriptionPatchOperation(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation Active { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation AddBegin { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation AddComplete { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation DeleteBegin { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation DeleteComplete { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation 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.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation left, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation left, Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation right) { throw null; } + public override string ToString() { throw null; } } public partial class NewRelicAccountProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -388,6 +352,40 @@ public NewRelicAppServicesGetContent(string userEmail) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NewRelicBillingInfoResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NewRelicBillingInfoResult() { } + public Azure.ResourceManager.NewRelicObservability.Models.MarketplaceSaaSInfo MarketplaceSaasInfo { get { throw null; } } + public Azure.ResourceManager.NewRelicObservability.Models.PartnerBillingEntity PartnerBillingEntity { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicBillingInfoResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicBillingInfoResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NewRelicConnectedPartnerResourceInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NewRelicConnectedPartnerResourceInfo() { } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceProperties Properties { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NewRelicConnectedPartnerResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NewRelicConnectedPartnerResourceProperties() { } + public string AccountId { get { throw null; } } + public string AccountName { get { throw null; } } + public string AzureResourceId { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicConnectedPartnerResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NewRelicHostsGetContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NewRelicHostsGetContent(string userEmail) { } @@ -448,6 +446,63 @@ internal NewRelicMetricsStatusResult() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NewRelicMonitoredSubscriptionInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NewRelicMonitoredSubscriptionInfo() { } + public string Error { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus? Status { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringTagRules TagRules { get { throw null; } set { } } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NewRelicMonitoredSubscriptionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NewRelicMonitoredSubscriptionProperties() { } + public System.Collections.Generic.IList MonitoredSubscriptionList { get { throw null; } } + public Azure.ResourceManager.NewRelicObservability.Models.MonitoredSubscriptionPatchOperation? PatchOperation { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoredSubscriptionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 NewRelicMonitoringStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NewRelicMonitoringStatus(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus Active { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus Failed { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus InProgress { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus 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.NewRelicObservability.Models.NewRelicMonitoringStatus left, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus left, Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NewRelicMonitoringTagRules : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NewRelicMonitoringTagRules() { } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityLogRules LogRules { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityMetricRules MetricRules { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringTagRules System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NewRelicObservability.Models.NewRelicMonitoringTagRules System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NewRelicMonitorResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NewRelicMonitorResourcePatch() { } @@ -507,6 +562,25 @@ internal NewRelicObservabilityAppServiceInfo() { } 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 NewRelicObservabilityBillingCycle : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NewRelicObservabilityBillingCycle(string value) { throw null; } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle Monthly { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle Weekly { get { throw null; } } + public static Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle Yearly { get { throw null; } } + public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle 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.NewRelicObservability.Models.NewRelicObservabilityBillingCycle left, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle right) { throw null; } + public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle left, Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct NewRelicObservabilityBillingSource : System.IEquatable { private readonly object _dummy; @@ -833,8 +907,9 @@ public NewRelicPlanData() { } public partial class NewRelicPlanDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NewRelicPlanDetails() { } - public string BillingCycle { get { throw null; } set { } } + public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityBillingCycle? BillingCycle { get { throw null; } set { } } public System.DateTimeOffset? EffectiveOn { get { throw null; } set { } } + public string NewRelicPlanBillingCycle { get { throw null; } set { } } public string PlanDetails { get { throw null; } set { } } public Azure.ResourceManager.NewRelicObservability.Models.NewRelicObservabilityUsageType? UsageType { get { throw null; } set { } } Azure.ResourceManager.NewRelicObservability.Models.NewRelicPlanDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -939,57 +1014,4 @@ internal PartnerBillingEntity() { } string System.ClientModel.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 PatchOperation : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public PatchOperation(string value) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation Active { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation AddBegin { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation AddComplete { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation DeleteBegin { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.PatchOperation DeleteComplete { get { throw null; } } - public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation 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.NewRelicObservability.Models.PatchOperation left, Azure.ResourceManager.NewRelicObservability.Models.PatchOperation right) { throw null; } - public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.PatchOperation (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.PatchOperation left, Azure.ResourceManager.NewRelicObservability.Models.PatchOperation right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct Status : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public Status(string value) { throw null; } - public static Azure.ResourceManager.NewRelicObservability.Models.Status Active { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.Status Deleting { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.Status Failed { get { throw null; } } - public static Azure.ResourceManager.NewRelicObservability.Models.Status InProgress { get { throw null; } } - public bool Equals(Azure.ResourceManager.NewRelicObservability.Models.Status 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.NewRelicObservability.Models.Status left, Azure.ResourceManager.NewRelicObservability.Models.Status right) { throw null; } - public static implicit operator Azure.ResourceManager.NewRelicObservability.Models.Status (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.NewRelicObservability.Models.Status left, Azure.ResourceManager.NewRelicObservability.Models.Status right) { throw null; } - public override string ToString() { throw null; } - } - public partial class SubscriptionList : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public SubscriptionList() { } - public System.Collections.Generic.IList MonitoredSubscriptionList { get { throw null; } } - public Azure.ResourceManager.NewRelicObservability.Models.PatchOperation? PatchOperation { get { throw null; } set { } } - public Azure.ResourceManager.NewRelicObservability.Models.NewRelicProvisioningState? ProvisioningState { get { throw null; } } - Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.NewRelicObservability.Models.SubscriptionList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs index 264ec89e09a59..0710fc49b2d6c 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResource.cs @@ -145,7 +145,7 @@ public async Task Update_MonitorsUpdateMaximumSetGen() PlanData = new NewRelicPlanDetails() { UsageType = NewRelicObservabilityUsageType.Payg, - BillingCycle = "Yearly", + NewRelicPlanBillingCycle = "Yearly", PlanDetails = "tbbiaga", EffectiveOn = DateTimeOffset.Parse("2022-12-05T14:11:37.786Z"), }, @@ -445,7 +445,7 @@ public async Task SwitchBilling_MonitorsSwitchBillingMaximumSetGen() PlanData = new NewRelicPlanDetails() { UsageType = NewRelicObservabilityUsageType.Payg, - BillingCycle = "Yearly", + NewRelicPlanBillingCycle = "Yearly", PlanDetails = "tbbiaga", EffectiveOn = DateTimeOffset.Parse("2022-12-05T14:11:37.786Z"), }, @@ -731,7 +731,7 @@ public async Task GetBillingInfo_BillingInfoGet() NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); // invoke the operation - BillingInfoResult result = await newRelicMonitorResource.GetBillingInfoAsync(); + NewRelicBillingInfoResult result = await newRelicMonitorResource.GetBillingInfoAsync(); Console.WriteLine($"Succeeded: {result}"); } @@ -758,7 +758,7 @@ public async Task GetConnectedPartnerResources_ConnectedPartnerResourcesList() NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); // invoke the operation and iterate over the result - await foreach (ConnectedPartnerResourcesListFormat item in newRelicMonitorResource.GetConnectedPartnerResourcesAsync()) + await foreach (NewRelicConnectedPartnerResourceInfo item in newRelicMonitorResource.GetConnectedPartnerResourcesAsync()) { Console.WriteLine($"Succeeded: {item}"); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs index 9acea1f0f8b47..bc76164b22f1f 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitorResourceCollection.cs @@ -222,7 +222,7 @@ public async Task CreateOrUpdate_MonitorsCreateOrUpdateMaximumSetGen() PlanData = new NewRelicPlanDetails() { UsageType = NewRelicObservabilityUsageType.Payg, - BillingCycle = "Yearly", + NewRelicPlanBillingCycle = "Yearly", PlanDetails = "tbbiaga", EffectiveOn = DateTimeOffset.Parse("2022-12-05T14:11:37.786Z"), }, diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitoredSubscriptionCollection.cs similarity index 82% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitoredSubscriptionCollection.cs index 88129c10b2f4b..c602bfd8b4181 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitoredSubscriptionCollection.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Samples { - public partial class Sample_MonitoredSubscriptionPropertyCollection + public partial class Sample_NewRelicMonitoredSubscriptionCollection { // Monitors_GetMonitoredSubscriptions [NUnit.Framework.Test] @@ -36,15 +36,15 @@ public async Task GetAll_MonitorsGetMonitoredSubscriptions() ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); - // get the collection of this MonitoredSubscriptionPropertyResource - MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + // get the collection of this NewRelicMonitoredSubscriptionResource + NewRelicMonitoredSubscriptionCollection collection = newRelicMonitorResource.GetNewRelicMonitoredSubscriptions(); // invoke the operation and iterate over the result - await foreach (MonitoredSubscriptionPropertyResource item in collection.GetAllAsync()) + await foreach (NewRelicMonitoredSubscriptionResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MonitoredSubscriptionPropertyData resourceData = item.Data; + NewRelicMonitoredSubscriptionData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -73,16 +73,16 @@ public async Task Get_MonitorsGetMonitoredSubscriptions() ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); - // get the collection of this MonitoredSubscriptionPropertyResource - MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + // get the collection of this NewRelicMonitoredSubscriptionResource + NewRelicMonitoredSubscriptionCollection collection = newRelicMonitorResource.GetNewRelicMonitoredSubscriptions(); // invoke the operation - ConfigurationName configurationName = ConfigurationName.Default; - MonitoredSubscriptionPropertyResource result = await collection.GetAsync(configurationName); + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; + NewRelicMonitoredSubscriptionResource result = await collection.GetAsync(configurationName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MonitoredSubscriptionPropertyData resourceData = result.Data; + NewRelicMonitoredSubscriptionData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -108,11 +108,11 @@ public async Task Exists_MonitorsGetMonitoredSubscriptions() ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); - // get the collection of this MonitoredSubscriptionPropertyResource - MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + // get the collection of this NewRelicMonitoredSubscriptionResource + NewRelicMonitoredSubscriptionCollection collection = newRelicMonitorResource.GetNewRelicMonitoredSubscriptions(); // invoke the operation - ConfigurationName configurationName = ConfigurationName.Default; + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; bool result = await collection.ExistsAsync(configurationName); Console.WriteLine($"Succeeded: {result}"); @@ -139,13 +139,13 @@ public async Task GetIfExists_MonitorsGetMonitoredSubscriptions() ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); - // get the collection of this MonitoredSubscriptionPropertyResource - MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + // get the collection of this NewRelicMonitoredSubscriptionResource + NewRelicMonitoredSubscriptionCollection collection = newRelicMonitorResource.GetNewRelicMonitoredSubscriptions(); // invoke the operation - ConfigurationName configurationName = ConfigurationName.Default; - NullableResponse response = await collection.GetIfExistsAsync(configurationName); - MonitoredSubscriptionPropertyResource result = response.HasValue ? response.Value : null; + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; + NullableResponse response = await collection.GetIfExistsAsync(configurationName); + NewRelicMonitoredSubscriptionResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -155,7 +155,7 @@ public async Task GetIfExists_MonitorsGetMonitoredSubscriptions() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MonitoredSubscriptionPropertyData resourceData = result.Data; + NewRelicMonitoredSubscriptionData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -182,18 +182,18 @@ public async Task CreateOrUpdate_MonitorsAddMonitoredSubscriptions() ResourceIdentifier newRelicMonitorResourceId = NewRelicMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); NewRelicMonitorResource newRelicMonitorResource = client.GetNewRelicMonitorResource(newRelicMonitorResourceId); - // get the collection of this MonitoredSubscriptionPropertyResource - MonitoredSubscriptionPropertyCollection collection = newRelicMonitorResource.GetMonitoredSubscriptionProperties(); + // get the collection of this NewRelicMonitoredSubscriptionResource + NewRelicMonitoredSubscriptionCollection collection = newRelicMonitorResource.GetNewRelicMonitoredSubscriptions(); // invoke the operation - ConfigurationName configurationName = ConfigurationName.Default; - MonitoredSubscriptionPropertyData data = new MonitoredSubscriptionPropertyData(); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, data); - MonitoredSubscriptionPropertyResource result = lro.Value; + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; + NewRelicMonitoredSubscriptionData data = new NewRelicMonitoredSubscriptionData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, data); + NewRelicMonitoredSubscriptionResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MonitoredSubscriptionPropertyData resourceData = result.Data; + NewRelicMonitoredSubscriptionData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitoredSubscriptionResource.cs similarity index 63% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitoredSubscriptionResource.cs index 8bc14074ddd08..c4d8a67784f9a 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/samples/Generated/Samples/Sample_NewRelicMonitoredSubscriptionResource.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Samples { - public partial class Sample_MonitoredSubscriptionPropertyResource + public partial class Sample_NewRelicMonitoredSubscriptionResource { // Monitors_GetMonitoredSubscriptions [NUnit.Framework.Test] @@ -28,21 +28,21 @@ public async Task Get_MonitorsGetMonitoredSubscriptions() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this MonitoredSubscriptionPropertyResource created on azure - // for more information of creating MonitoredSubscriptionPropertyResource, please refer to the document of MonitoredSubscriptionPropertyResource + // this example assumes you already have this NewRelicMonitoredSubscriptionResource created on azure + // for more information of creating NewRelicMonitoredSubscriptionResource, please refer to the document of NewRelicMonitoredSubscriptionResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string monitorName = "myMonitor"; - ConfigurationName configurationName = ConfigurationName.Default; - ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); - MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; + ResourceIdentifier newRelicMonitoredSubscriptionResourceId = NewRelicMonitoredSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + NewRelicMonitoredSubscriptionResource newRelicMonitoredSubscription = client.GetNewRelicMonitoredSubscriptionResource(newRelicMonitoredSubscriptionResourceId); // invoke the operation - MonitoredSubscriptionPropertyResource result = await monitoredSubscriptionProperty.GetAsync(); + NewRelicMonitoredSubscriptionResource result = await newRelicMonitoredSubscription.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MonitoredSubscriptionPropertyData resourceData = result.Data; + NewRelicMonitoredSubscriptionData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -60,23 +60,23 @@ public async Task Update_MonitorsUpdateMonitoredSubscriptions() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this MonitoredSubscriptionPropertyResource created on azure - // for more information of creating MonitoredSubscriptionPropertyResource, please refer to the document of MonitoredSubscriptionPropertyResource + // this example assumes you already have this NewRelicMonitoredSubscriptionResource created on azure + // for more information of creating NewRelicMonitoredSubscriptionResource, please refer to the document of NewRelicMonitoredSubscriptionResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string monitorName = "myMonitor"; - ConfigurationName configurationName = ConfigurationName.Default; - ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); - MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; + ResourceIdentifier newRelicMonitoredSubscriptionResourceId = NewRelicMonitoredSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + NewRelicMonitoredSubscriptionResource newRelicMonitoredSubscription = client.GetNewRelicMonitoredSubscriptionResource(newRelicMonitoredSubscriptionResourceId); // invoke the operation - MonitoredSubscriptionPropertyData data = new MonitoredSubscriptionPropertyData(); - ArmOperation lro = await monitoredSubscriptionProperty.UpdateAsync(WaitUntil.Completed, data); - MonitoredSubscriptionPropertyResource result = lro.Value; + NewRelicMonitoredSubscriptionData data = new NewRelicMonitoredSubscriptionData(); + ArmOperation lro = await newRelicMonitoredSubscription.UpdateAsync(WaitUntil.Completed, data); + NewRelicMonitoredSubscriptionResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - MonitoredSubscriptionPropertyData resourceData = result.Data; + NewRelicMonitoredSubscriptionData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -94,17 +94,17 @@ public async Task Delete_MonitorsDeleteMonitoredSubscriptions() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this MonitoredSubscriptionPropertyResource created on azure - // for more information of creating MonitoredSubscriptionPropertyResource, please refer to the document of MonitoredSubscriptionPropertyResource + // this example assumes you already have this NewRelicMonitoredSubscriptionResource created on azure + // for more information of creating NewRelicMonitoredSubscriptionResource, please refer to the document of NewRelicMonitoredSubscriptionResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; string monitorName = "myMonitor"; - ConfigurationName configurationName = ConfigurationName.Default; - ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); - MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + MonitoredSubscriptionConfigurationName configurationName = MonitoredSubscriptionConfigurationName.Default; + ResourceIdentifier newRelicMonitoredSubscriptionResourceId = NewRelicMonitoredSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + NewRelicMonitoredSubscriptionResource newRelicMonitoredSubscription = client.GetNewRelicMonitoredSubscriptionResource(newRelicMonitoredSubscriptionResourceId); // invoke the operation - await monitoredSubscriptionProperty.DeleteAsync(WaitUntil.Completed); + await newRelicMonitoredSubscription.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Azure.ResourceManager.NewRelicObservability.csproj b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Azure.ResourceManager.NewRelicObservability.csproj index 10e394d95cd1a..52b658f17d70f 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Azure.ResourceManager.NewRelicObservability.csproj +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Azure.ResourceManager.NewRelicObservability.csproj @@ -1,6 +1,6 @@ - 1.1.0-beta.1 + 1.1.0 1.0.1 Azure.ResourceManager.NewRelicObservability diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityBillingCycle.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicObservabilityBillingCycle.cs similarity index 99% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityBillingCycle.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicObservabilityBillingCycle.cs index b00cb7d17f938..5a6e93dd72e78 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityBillingCycle.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicObservabilityBillingCycle.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// - #nullable disable using System; diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicPlanDetails.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicPlanDetails.cs new file mode 100644 index 0000000000000..a8781b35d2f92 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/Models/NewRelicPlanDetails.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// Plan data of NewRelic Monitor resource. + public partial class NewRelicPlanDetails + { + /// Different billing cycles like Monthly/Weekly. + public NewRelicObservabilityBillingCycle? BillingCycle { get => new NewRelicObservabilityBillingCycle(NewRelicPlanBillingCycle); set => NewRelicPlanBillingCycle = value.ToString(); } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/NewRelicMonitorResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/NewRelicMonitorResource.cs new file mode 100644 index 0000000000000..f788d4ebcf33f --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Custom/NewRelicMonitorResource.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.NewRelicObservability.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.NewRelicObservability +{ + /// + /// A Class representing a NewRelicMonitorResource 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 GetNewRelicMonitorResource method. + /// Otherwise you can get one from its parent resource using the GetNewRelicMonitorResource method. + /// + public partial class NewRelicMonitorResource : ArmResource + { + /// + /// Update a NewRelicMonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Update + /// + /// + /// Default Api Version + /// 2022-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken) + { + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new NewRelicMonitorResource(Client, result.Value.Data), result.GetRawResponse()); + } + + /// + /// Update a NewRelicMonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Update + /// + /// + /// Default Api Version + /// 2022-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken) + { + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken); + return Response.FromValue(new NewRelicMonitorResource(Client, result.Value.Data), result.GetRawResponse()); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs index 45a91eb10796e..2657f15edea46 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/ArmNewRelicObservabilityModelFactory.cs @@ -227,13 +227,13 @@ public static NewRelicResourceMonitorResult NewRelicResourceMonitorResult(Resour serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Marketplace Subscription details. /// Partner Billing Entity details: Organization Info. - /// A new instance for mocking. - public static BillingInfoResult BillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo = null, PartnerBillingEntity partnerBillingEntity = null) + /// A new instance for mocking. + public static NewRelicBillingInfoResult NewRelicBillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo = null, PartnerBillingEntity partnerBillingEntity = null) { - return new BillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, serializedAdditionalRawData: null); + return new NewRelicBillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -263,23 +263,23 @@ public static PartnerBillingEntity PartnerBillingEntity(string organizationId = return new PartnerBillingEntity(organizationId, organizationName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Connected Partner Resource Properties. - /// A new instance for mocking. - public static ConnectedPartnerResourcesListFormat ConnectedPartnerResourcesListFormat(ConnectedPartnerResourceProperties properties = null) + /// A new instance for mocking. + public static NewRelicConnectedPartnerResourceInfo NewRelicConnectedPartnerResourceInfo(NewRelicConnectedPartnerResourceProperties properties = null) { - return new ConnectedPartnerResourcesListFormat(properties, serializedAdditionalRawData: null); + return new NewRelicConnectedPartnerResourceInfo(properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// NewRelic account name. /// NewRelic Account Id. /// The azure resource Id of the deployment. /// The location of the deployment. - /// A new instance for mocking. - public static ConnectedPartnerResourceProperties ConnectedPartnerResourceProperties(string accountName = null, string accountId = null, string azureResourceId = null, AzureLocation? location = null) + /// A new instance for mocking. + public static NewRelicConnectedPartnerResourceProperties NewRelicConnectedPartnerResourceProperties(string accountName = null, string accountId = null, string azureResourceId = null, AzureLocation? location = null) { - return new ConnectedPartnerResourceProperties(accountName, accountId, azureResourceId, location, serializedAdditionalRawData: null); + return new NewRelicConnectedPartnerResourceProperties(accountName, accountId, azureResourceId, location, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -304,26 +304,26 @@ public static NewRelicObservabilityTagRuleData NewRelicObservabilityTagRuleData( serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Provisioning State of the resource. /// Set of rules for sending logs for the Monitor resource. /// Set of rules for sending metrics for the Monitor resource. - /// A new instance for mocking. - public static MonitoringTagRulesProperties MonitoringTagRulesProperties(NewRelicProvisioningState? provisioningState = null, NewRelicObservabilityLogRules logRules = null, NewRelicObservabilityMetricRules metricRules = null) + /// A new instance for mocking. + public static NewRelicMonitoringTagRules NewRelicMonitoringTagRules(NewRelicProvisioningState? provisioningState = null, NewRelicObservabilityLogRules logRules = null, NewRelicObservabilityMetricRules metricRules = null) { - return new MonitoringTagRulesProperties(provisioningState, logRules, metricRules, serializedAdditionalRawData: null); + return new NewRelicMonitoringTagRules(provisioningState, logRules, metricRules, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. - /// A new instance for mocking. - public static MonitoredSubscriptionPropertyData MonitoredSubscriptionPropertyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SubscriptionList properties = null) + /// A new instance for mocking. + public static NewRelicMonitoredSubscriptionData NewRelicMonitoredSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NewRelicMonitoredSubscriptionProperties properties = null) { - return new MonitoredSubscriptionPropertyData( + return new NewRelicMonitoredSubscriptionData( id, name, resourceType, @@ -332,16 +332,16 @@ public static MonitoredSubscriptionPropertyData MonitoredSubscriptionPropertyDat serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The operation for the patch on the resource. /// List of subscriptions and the state of the monitoring. /// Provisioning State of the resource. - /// A new instance for mocking. - public static SubscriptionList SubscriptionList(PatchOperation? patchOperation = null, IEnumerable monitoredSubscriptionList = null, NewRelicProvisioningState? provisioningState = null) + /// A new instance for mocking. + public static NewRelicMonitoredSubscriptionProperties NewRelicMonitoredSubscriptionProperties(MonitoredSubscriptionPatchOperation? patchOperation = null, IEnumerable monitoredSubscriptionList = null, NewRelicProvisioningState? provisioningState = null) { - monitoredSubscriptionList ??= new List(); + monitoredSubscriptionList ??= new List(); - return new SubscriptionList(patchOperation, monitoredSubscriptionList?.ToList(), provisioningState, serializedAdditionalRawData: null); + return new NewRelicMonitoredSubscriptionProperties(patchOperation, monitoredSubscriptionList?.ToList(), provisioningState, serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs index a5d5bc453e01c..3c13013153912 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/MockableNewRelicObservabilityArmClient.cs @@ -59,15 +59,15 @@ public virtual NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagR } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(ResourceIdentifier id) + /// Returns a object. + public virtual NewRelicMonitoredSubscriptionResource GetNewRelicMonitoredSubscriptionResource(ResourceIdentifier id) { - MonitoredSubscriptionPropertyResource.ValidateResourceId(id); - return new MonitoredSubscriptionPropertyResource(Client, id); + NewRelicMonitoredSubscriptionResource.ValidateResourceId(id); + return new NewRelicMonitoredSubscriptionResource(Client, id); } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs index 4b9f5a35448e5..9e0307b6d16be 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs @@ -72,22 +72,22 @@ public static NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagRu } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NewRelicMonitoredSubscriptionResource GetNewRelicMonitoredSubscriptionResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableNewRelicObservabilityArmClient(client).GetMonitoredSubscriptionPropertyResource(id); + return GetMockableNewRelicObservabilityArmClient(client).GetNewRelicMonitoredSubscriptionResource(id); } /// diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/BicepSerializationHelpers.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/BicepSerializationHelpers.cs new file mode 100644 index 0000000000000..d7990e4bc98a0 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/BicepSerializationHelpers.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text; + +namespace Azure.ResourceManager.NewRelicObservability +{ + internal static class BicepSerializationHelpers + { + public static void AppendChildObject(StringBuilder stringBuilder, object childObject, ModelReaderWriterOptions options, int spaces, bool indentFirstLine, string formattedPropertyName) + { + string indent = new string(' ', spaces); + int emptyObjectLength = 2 + spaces + Environment.NewLine.Length + Environment.NewLine.Length; + int length = stringBuilder.Length; + bool inMultilineString = false; + + BinaryData data = ModelReaderWriter.Write(childObject, options); + string[] lines = data.ToString().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + for (int i = 0; i < lines.Length; i++) + { + string line = lines[i]; + if (inMultilineString) + { + if (line.Contains("'''")) + { + inMultilineString = false; + } + stringBuilder.AppendLine(line); + continue; + } + if (line.Contains("'''")) + { + inMultilineString = true; + stringBuilder.AppendLine($"{indent}{line}"); + continue; + } + if (i == 0 && !indentFirstLine) + { + stringBuilder.AppendLine($"{line}"); + } + else + { + stringBuilder.AppendLine($"{indent}{line}"); + } + } + if (stringBuilder.Length == length + emptyObjectLength) + { + stringBuilder.Length = stringBuilder.Length - emptyObjectLength - formattedPropertyName.Length; + } + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/WirePathAttribute.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/WirePathAttribute.cs new file mode 100644 index 0000000000000..7da47797c8c1b --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Internal/WirePathAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.NewRelicObservability +{ + [AttributeUsage(AttributeTargets.Property)] + internal class WirePathAttribute : Attribute + { + private string _wirePath; + + public WirePathAttribute(string wirePath) + { + _wirePath = wirePath; + } + + public override string ToString() + { + return _wirePath; + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs deleted file mode 100644 index 440b23068cb3c..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.NewRelicObservability -{ - internal class MonitoredSubscriptionPropertyOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal MonitoredSubscriptionPropertyOperationSource(ArmClient client) - { - _client = client; - } - - MonitoredSubscriptionPropertyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); - return new MonitoredSubscriptionPropertyResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); - return new MonitoredSubscriptionPropertyResource(_client, data); - } - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/NewRelicMonitoredSubscriptionOperationSource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/NewRelicMonitoredSubscriptionOperationSource.cs new file mode 100644 index 0000000000000..59797be64ba47 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/LongRunningOperation/NewRelicMonitoredSubscriptionOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability +{ + internal class NewRelicMonitoredSubscriptionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NewRelicMonitoredSubscriptionOperationSource(ArmClient client) + { + _client = client; + } + + NewRelicMonitoredSubscriptionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(document.RootElement); + return new NewRelicMonitoredSubscriptionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(document.RootElement); + return new NewRelicMonitoredSubscriptionResource(_client, data); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs deleted file mode 100644 index 48cfed1c7618e..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConfigurationName.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.NewRelicObservability.Models -{ - /// The ConfigurationName. - public readonly partial struct ConfigurationName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ConfigurationName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DefaultValue = "default"; - - /// default. - public static ConfigurationName Default { get; } = new ConfigurationName(DefaultValue); - /// Determines if two values are the same. - public static bool operator ==(ConfigurationName left, ConfigurationName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ConfigurationName left, ConfigurationName right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ConfigurationName(string value) => new ConfigurationName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ConfigurationName other && Equals(other); - /// - public bool Equals(ConfigurationName 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs deleted file mode 100644 index e60793a75485d..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// 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.NewRelicObservability.Models -{ - public partial class ConnectedPartnerResourceProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ConnectedPartnerResourceProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(AccountName)) - { - writer.WritePropertyName("accountName"u8); - writer.WriteStringValue(AccountName); - } - if (Optional.IsDefined(AccountId)) - { - writer.WritePropertyName("accountId"u8); - writer.WriteStringValue(AccountId); - } - if (Optional.IsDefined(AzureResourceId)) - { - writer.WritePropertyName("azureResourceId"u8); - writer.WriteStringValue(AzureResourceId); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ConnectedPartnerResourceProperties 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(ConnectedPartnerResourceProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConnectedPartnerResourceProperties(document.RootElement, options); - } - - internal static ConnectedPartnerResourceProperties DeserializeConnectedPartnerResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string accountName = default; - string accountId = default; - string azureResourceId = default; - AzureLocation? location = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("accountName"u8)) - { - accountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("accountId"u8)) - { - accountId = property.Value.GetString(); - continue; - } - if (property.NameEquals("azureResourceId"u8)) - { - azureResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ConnectedPartnerResourceProperties(accountName, accountId, azureResourceId, location, 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(ConnectedPartnerResourceProperties)} does not support writing '{options.Format}' format."); - } - } - - ConnectedPartnerResourceProperties 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); - return DeserializeConnectedPartnerResourceProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ConnectedPartnerResourceProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs deleted file mode 100644 index a18e42c4c0109..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// 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.NewRelicObservability.Models -{ - public partial class ConnectedPartnerResourcesListFormat : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListFormat)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ConnectedPartnerResourcesListFormat 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(ConnectedPartnerResourcesListFormat)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConnectedPartnerResourcesListFormat(document.RootElement, options); - } - - internal static ConnectedPartnerResourcesListFormat DeserializeConnectedPartnerResourcesListFormat(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ConnectedPartnerResourceProperties properties = 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 = ConnectedPartnerResourceProperties.DeserializeConnectedPartnerResourceProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ConnectedPartnerResourcesListFormat(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(ConnectedPartnerResourcesListFormat)} does not support writing '{options.Format}' format."); - } - } - - ConnectedPartnerResourcesListFormat 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); - return DeserializeConnectedPartnerResourcesListFormat(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListFormat)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs index ac139feb07996..9067904aad901 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -79,7 +81,7 @@ internal static ConnectedPartnerResourcesListResponse DeserializeConnectedPartne { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +93,10 @@ internal static ConnectedPartnerResourcesListResponse DeserializeConnectedPartne { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ConnectedPartnerResourcesListFormat.DeserializeConnectedPartnerResourcesListFormat(item, options)); + array.Add(NewRelicConnectedPartnerResourceInfo.DeserializeNewRelicConnectedPartnerResourceInfo(item, options)); } value = array; continue; @@ -110,7 +112,68 @@ internal static ConnectedPartnerResourcesListResponse DeserializeConnectedPartne } } serializedAdditionalRawData = rawDataDictionary; - return new ConnectedPartnerResourcesListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ConnectedPartnerResourcesListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) @@ -121,6 +184,8 @@ BinaryData IPersistableModel.Write(ModelR { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(ConnectedPartnerResourcesListResponse)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs index e191c0580c2a2..0283591027dca 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListResponse.cs @@ -48,14 +48,14 @@ internal partial class ConnectedPartnerResourcesListResponse /// Initializes a new instance of . internal ConnectedPartnerResourcesListResponse() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// Results of a list operation. /// Link to the next set of results, if any. /// Keeps track of any properties unknown to the library. - internal ConnectedPartnerResourcesListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ConnectedPartnerResourcesListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal ConnectedPartnerResourcesListResponse(IReadOnlyList Results of a list operation. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// Link to the next set of results, if any. public string NextLink { get; } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs index cc7511005ff3c..ac87944e955d6 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/LinkedResourceListResponse.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Resources.Models; @@ -114,6 +116,67 @@ internal static LinkedResourceListResponse DeserializeLinkedResourceListResponse return new LinkedResourceListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +185,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(LinkedResourceListResponse)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs index 2986ed7cd4085..cfe2b460f78ba 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -138,6 +139,136 @@ internal static MarketplaceSaaSInfo DeserializeMarketplaceSaaSInfo(JsonElement e serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceSubscriptionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceSubscriptionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + builder.Append(" marketplaceSubscriptionId: "); + if (MarketplaceSubscriptionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MarketplaceSubscriptionId}'''"); + } + else + { + builder.AppendLine($"'{MarketplaceSubscriptionId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceSubscriptionName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceSubscriptionName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceSubscriptionName)) + { + builder.Append(" marketplaceSubscriptionName: "); + if (MarketplaceSubscriptionName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MarketplaceSubscriptionName}'''"); + } + else + { + builder.AppendLine($"'{MarketplaceSubscriptionName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceResourceId)) + { + builder.Append(" marketplaceResourceId: "); + if (MarketplaceResourceId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MarketplaceResourceId}'''"); + } + else + { + builder.AppendLine($"'{MarketplaceResourceId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceStatus)) + { + builder.Append(" marketplaceStatus: "); + if (MarketplaceStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MarketplaceStatus}'''"); + } + else + { + builder.AppendLine($"'{MarketplaceStatus}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BilledAzureSubscriptionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" billedAzureSubscriptionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BilledAzureSubscriptionId)) + { + builder.Append(" billedAzureSubscriptionId: "); + if (BilledAzureSubscriptionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{BilledAzureSubscriptionId}'''"); + } + else + { + builder.AppendLine($"'{BilledAzureSubscriptionId}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -146,6 +277,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MarketplaceSaaSInfo)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs index 06bc4ecc96144..11fd3ca1b125c 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MarketplaceSaaSInfo.cs @@ -68,14 +68,19 @@ internal MarketplaceSaaSInfo(string marketplaceSubscriptionId, string marketplac } /// Marketplace Subscription Id. This is a GUID-formatted string. + [WirePath("marketplaceSubscriptionId")] public string MarketplaceSubscriptionId { get; } /// Marketplace Subscription Details: SAAS Name. + [WirePath("marketplaceSubscriptionName")] public string MarketplaceSubscriptionName { get; } /// Marketplace Subscription Details: Resource URI. + [WirePath("marketplaceResourceId")] public string MarketplaceResourceId { get; } /// Marketplace Subscription Details: SaaS Subscription Status. + [WirePath("marketplaceStatus")] public string MarketplaceStatus { get; } /// The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + [WirePath("billedAzureSubscriptionId")] public string BilledAzureSubscriptionId { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs deleted file mode 100644 index 830eaa87a0f09..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// 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.NewRelicObservability.Models -{ - public partial class MonitoredSubscription : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MonitoredSubscription)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(SubscriptionId)) - { - writer.WritePropertyName("subscriptionId"u8); - writer.WriteStringValue(SubscriptionId); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteStringValue(Error); - } - if (Optional.IsDefined(TagRules)) - { - writer.WritePropertyName("tagRules"u8); - writer.WriteObjectValue(TagRules, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MonitoredSubscription 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(MonitoredSubscription)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoredSubscription(document.RootElement, options); - } - - internal static MonitoredSubscription DeserializeMonitoredSubscription(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string subscriptionId = default; - Status? status = default; - string error = default; - MonitoringTagRulesProperties tagRules = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("subscriptionId"u8)) - { - subscriptionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new Status(property.Value.GetString()); - continue; - } - if (property.NameEquals("error"u8)) - { - error = property.Value.GetString(); - continue; - } - if (property.NameEquals("tagRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tagRules = MonitoringTagRulesProperties.DeserializeMonitoringTagRulesProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MonitoredSubscription(subscriptionId, status, error, tagRules, 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(MonitoredSubscription)} does not support writing '{options.Format}' format."); - } - } - - MonitoredSubscription 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); - return DeserializeMonitoredSubscription(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MonitoredSubscription)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionConfigurationName.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionConfigurationName.cs new file mode 100644 index 0000000000000..4c692243400d2 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionConfigurationName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The MonitoredSubscriptionConfigurationName. + public readonly partial struct MonitoredSubscriptionConfigurationName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MonitoredSubscriptionConfigurationName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "default"; + + /// default. + public static MonitoredSubscriptionConfigurationName Default { get; } = new MonitoredSubscriptionConfigurationName(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(MonitoredSubscriptionConfigurationName left, MonitoredSubscriptionConfigurationName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MonitoredSubscriptionConfigurationName left, MonitoredSubscriptionConfigurationName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MonitoredSubscriptionConfigurationName(string value) => new MonitoredSubscriptionConfigurationName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MonitoredSubscriptionConfigurationName other && Equals(other); + /// + public bool Equals(MonitoredSubscriptionConfigurationName 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPatchOperation.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPatchOperation.cs new file mode 100644 index 0000000000000..359a4e7a00e0f --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPatchOperation.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The operation for the patch on the resource. + public readonly partial struct MonitoredSubscriptionPatchOperation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MonitoredSubscriptionPatchOperation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AddBeginValue = "AddBegin"; + private const string AddCompleteValue = "AddComplete"; + private const string DeleteBeginValue = "DeleteBegin"; + private const string DeleteCompleteValue = "DeleteComplete"; + private const string ActiveValue = "Active"; + + /// AddBegin. + public static MonitoredSubscriptionPatchOperation AddBegin { get; } = new MonitoredSubscriptionPatchOperation(AddBeginValue); + /// AddComplete. + public static MonitoredSubscriptionPatchOperation AddComplete { get; } = new MonitoredSubscriptionPatchOperation(AddCompleteValue); + /// DeleteBegin. + public static MonitoredSubscriptionPatchOperation DeleteBegin { get; } = new MonitoredSubscriptionPatchOperation(DeleteBeginValue); + /// DeleteComplete. + public static MonitoredSubscriptionPatchOperation DeleteComplete { get; } = new MonitoredSubscriptionPatchOperation(DeleteCompleteValue); + /// Active. + public static MonitoredSubscriptionPatchOperation Active { get; } = new MonitoredSubscriptionPatchOperation(ActiveValue); + /// Determines if two values are the same. + public static bool operator ==(MonitoredSubscriptionPatchOperation left, MonitoredSubscriptionPatchOperation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MonitoredSubscriptionPatchOperation left, MonitoredSubscriptionPatchOperation right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MonitoredSubscriptionPatchOperation(string value) => new MonitoredSubscriptionPatchOperation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MonitoredSubscriptionPatchOperation other && Equals(other); + /// + public bool Equals(MonitoredSubscriptionPatchOperation 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs index 74cd244858b43..f9d530a877c32 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -79,7 +81,7 @@ internal static MonitoredSubscriptionPropertiesList DeserializeMonitoredSubscrip { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +93,10 @@ internal static MonitoredSubscriptionPropertiesList DeserializeMonitoredSubscrip { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(item, options)); + array.Add(NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(item, options)); } value = array; continue; @@ -110,7 +112,68 @@ internal static MonitoredSubscriptionPropertiesList DeserializeMonitoredSubscrip } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoredSubscriptionPropertiesList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new MonitoredSubscriptionPropertiesList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) @@ -121,6 +184,8 @@ BinaryData IPersistableModel.Write(ModelRea { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertiesList)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs index bb2cd21b1bb8c..83d555882f259 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs @@ -48,14 +48,14 @@ internal partial class MonitoredSubscriptionPropertiesList /// Initializes a new instance of . internal MonitoredSubscriptionPropertiesList() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal MonitoredSubscriptionPropertiesList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal MonitoredSubscriptionPropertiesList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal MonitoredSubscriptionPropertiesList(IReadOnlyList Gets the value. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public string NextLink { get; } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.Serialization.cs index b0ab189eaa176..1773c90cb595f 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -133,6 +134,92 @@ internal static NewRelicAccountProperties DeserializeNewRelicAccountProperties(J return new NewRelicAccountProperties(userId, accountInfo, organizationInfo, singleSignOnProperties, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UserId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" userId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UserId)) + { + builder.Append(" userId: "); + if (UserId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UserId}'''"); + } + else + { + builder.AppendLine($"'{UserId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountInfo)) + { + builder.Append(" accountInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, AccountInfo, options, 2, false, " accountInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("OrganizationId", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationInfo: "); + builder.AppendLine("{"); + builder.Append(" organizationId: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(OrganizationInfo)) + { + builder.Append(" organizationInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, OrganizationInfo, options, 2, false, " organizationInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SingleSignOnProperties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" singleSignOnProperties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SingleSignOnProperties)) + { + builder.Append(" singleSignOnProperties: "); + BicepSerializationHelpers.AppendChildObject(builder, SingleSignOnProperties, options, 2, false, " singleSignOnProperties: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -141,6 +228,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicAccountProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.cs index 8f9b282b44ee7..ae69a383546e2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountProperties.cs @@ -66,12 +66,15 @@ internal NewRelicAccountProperties(string userId, NewRelicObservabilityAccountIn } /// User id. + [WirePath("userId")] public string UserId { get; set; } /// NewRelic Account Information. + [WirePath("accountInfo")] public NewRelicObservabilityAccountInfo AccountInfo { get; set; } /// NewRelic Organization Information. internal NewRelicObservabilityOrganizationInfo OrganizationInfo { get; set; } /// Organization id. + [WirePath("organizationInfo.organizationId")] public string OrganizationId { get => OrganizationInfo is null ? default : OrganizationInfo.OrganizationId; @@ -84,6 +87,7 @@ public string OrganizationId } /// date when plan was applied. + [WirePath("singleSignOnProperties")] public NewRelicSingleSignOnProperties SingleSignOnProperties { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.Serialization.cs index 0364fe56d8835..32ccb38cbc394 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -198,6 +199,161 @@ internal static NewRelicAccountResourceData DeserializeNewRelicAccountResourceDa serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrganizationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrganizationId)) + { + builder.Append(" organizationId: "); + if (OrganizationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OrganizationId}'''"); + } + else + { + builder.AppendLine($"'{OrganizationId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountId)) + { + builder.Append(" accountId: "); + if (AccountId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountId}'''"); + } + else + { + builder.AppendLine($"'{AccountId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountName)) + { + builder.Append(" accountName: "); + if (AccountName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountName}'''"); + } + else + { + builder.AppendLine($"'{AccountName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Region), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" region: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Region)) + { + builder.Append(" region: "); + builder.AppendLine($"'{Region.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -206,6 +362,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicAccountResourceData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs index 55732d55467ef..7f2af3d44fb66 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountResourceData.cs @@ -72,12 +72,16 @@ internal NewRelicAccountResourceData(ResourceIdentifier id, string name, Resourc } /// organization id. + [WirePath("properties.organizationId")] public string OrganizationId { get; set; } /// account id. + [WirePath("properties.accountId")] public string AccountId { get; set; } /// account name. + [WirePath("properties.accountName")] public string AccountName { get; set; } /// Region where New Relic account is present. + [WirePath("properties.region")] public AzureLocation? Region { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountsListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountsListResult.Serialization.cs index 0431d1ba01283..69603112eb790 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountsListResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAccountsListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicAccountsListResult DeserializeNewRelicAccountsListResult return new NewRelicAccountsListResult(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicAccountsListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesGetContent.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesGetContent.cs index d5c54518b93a9..0154670c03471 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesGetContent.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesGetContent.cs @@ -74,8 +74,10 @@ internal NewRelicAppServicesGetContent() } /// Azure resource IDs. + [WirePath("azureResourceIds")] public IList AzureResourceIds { get; } /// User Email. + [WirePath("userEmail")] public string UserEmail { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesListResult.Serialization.cs index 817273792fc47..cfcf96e5a60d9 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesListResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicAppServicesListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicAppServicesListResult DeserializeNewRelicAppServicesList return new NewRelicAppServicesListResult(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicAppServicesListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicBillingInfoResult.Serialization.cs similarity index 50% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicBillingInfoResult.Serialization.cs index 593e1d7728889..f4ca254b065f4 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicBillingInfoResult.Serialization.cs @@ -8,21 +8,22 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; namespace Azure.ResourceManager.NewRelicObservability.Models { - public partial class BillingInfoResult : IUtf8JsonSerializable, IJsonModel + public partial class NewRelicBillingInfoResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BillingInfoResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NewRelicBillingInfoResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -54,19 +55,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteEndObject(); } - BillingInfoResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NewRelicBillingInfoResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BillingInfoResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NewRelicBillingInfoResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBillingInfoResult(document.RootElement, options); + return DeserializeNewRelicBillingInfoResult(document.RootElement, options); } - internal static BillingInfoResult DeserializeBillingInfoResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static NewRelicBillingInfoResult DeserializeNewRelicBillingInfoResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -104,38 +105,85 @@ internal static BillingInfoResult DeserializeBillingInfoResult(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new BillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, serializedAdditionalRawData); + return new NewRelicBillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + private BinaryData SerializeBicep(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceSaasInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceSaasInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceSaasInfo)) + { + builder.Append(" marketplaceSaasInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, MarketplaceSaasInfo, options, 2, false, " marketplaceSaasInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerBillingEntity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" partnerBillingEntity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PartnerBillingEntity)) + { + builder.Append(" partnerBillingEntity: "); + BicepSerializationHelpers.AppendChildObject(builder, PartnerBillingEntity, options, 2, false, " partnerBillingEntity: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(BillingInfoResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NewRelicBillingInfoResult)} does not support writing '{options.Format}' format."); } } - BillingInfoResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NewRelicBillingInfoResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBillingInfoResult(document.RootElement, options); + return DeserializeNewRelicBillingInfoResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BillingInfoResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NewRelicBillingInfoResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicBillingInfoResult.cs similarity index 81% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicBillingInfoResult.cs index f654b0d3e7e13..29052bfb9d9c5 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/BillingInfoResult.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicBillingInfoResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// Marketplace Subscription and Organization details to which resource gets billed into. - public partial class BillingInfoResult + public partial class NewRelicBillingInfoResult { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class BillingInfoResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BillingInfoResult() + /// Initializes a new instance of . + internal NewRelicBillingInfoResult() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Marketplace Subscription details. /// Partner Billing Entity details: Organization Info. /// Keeps track of any properties unknown to the library. - internal BillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo, PartnerBillingEntity partnerBillingEntity, IDictionary serializedAdditionalRawData) + internal NewRelicBillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo, PartnerBillingEntity partnerBillingEntity, IDictionary serializedAdditionalRawData) { MarketplaceSaasInfo = marketplaceSaasInfo; PartnerBillingEntity = partnerBillingEntity; @@ -62,8 +62,10 @@ internal BillingInfoResult(MarketplaceSaaSInfo marketplaceSaasInfo, PartnerBilli } /// Marketplace Subscription details. + [WirePath("marketplaceSaasInfo")] public MarketplaceSaaSInfo MarketplaceSaasInfo { get; } /// Partner Billing Entity details: Organization Info. + [WirePath("partnerBillingEntity")] public PartnerBillingEntity PartnerBillingEntity { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.Serialization.cs new file mode 100644 index 0000000000000..7ac37a387f34b --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + public partial class NewRelicConnectedPartnerResourceInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NewRelicConnectedPartnerResourceInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NewRelicConnectedPartnerResourceInfo 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(NewRelicConnectedPartnerResourceInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNewRelicConnectedPartnerResourceInfo(document.RootElement, options); + } + + internal static NewRelicConnectedPartnerResourceInfo DeserializeNewRelicConnectedPartnerResourceInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NewRelicConnectedPartnerResourceProperties properties = 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 = NewRelicConnectedPartnerResourceProperties.DeserializeNewRelicConnectedPartnerResourceProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NewRelicConnectedPartnerResourceInfo(properties, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NewRelicConnectedPartnerResourceInfo)} does not support writing '{options.Format}' format."); + } + } + + NewRelicConnectedPartnerResourceInfo 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); + return DeserializeNewRelicConnectedPartnerResourceInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NewRelicConnectedPartnerResourceInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.cs similarity index 77% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.cs index 12e6a0d27a47d..032c798cd92c5 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourcesListFormat.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceInfo.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// Connected Partner Resources List Format. - public partial class ConnectedPartnerResourcesListFormat + public partial class NewRelicConnectedPartnerResourceInfo { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,22 @@ public partial class ConnectedPartnerResourcesListFormat /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ConnectedPartnerResourcesListFormat() + /// Initializes a new instance of . + internal NewRelicConnectedPartnerResourceInfo() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Connected Partner Resource Properties. /// Keeps track of any properties unknown to the library. - internal ConnectedPartnerResourcesListFormat(ConnectedPartnerResourceProperties properties, IDictionary serializedAdditionalRawData) + internal NewRelicConnectedPartnerResourceInfo(NewRelicConnectedPartnerResourceProperties properties, IDictionary serializedAdditionalRawData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Connected Partner Resource Properties. - public ConnectedPartnerResourceProperties Properties { get; } + [WirePath("properties")] + public NewRelicConnectedPartnerResourceProperties Properties { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.Serialization.cs new file mode 100644 index 0000000000000..a3127e7b1194f --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.Serialization.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + public partial class NewRelicConnectedPartnerResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NewRelicConnectedPartnerResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AccountName)) + { + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + } + if (Optional.IsDefined(AccountId)) + { + writer.WritePropertyName("accountId"u8); + writer.WriteStringValue(AccountId); + } + if (Optional.IsDefined(AzureResourceId)) + { + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NewRelicConnectedPartnerResourceProperties 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(NewRelicConnectedPartnerResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNewRelicConnectedPartnerResourceProperties(document.RootElement, options); + } + + internal static NewRelicConnectedPartnerResourceProperties DeserializeNewRelicConnectedPartnerResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accountName = default; + string accountId = default; + string azureResourceId = default; + AzureLocation? location = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountId"u8)) + { + accountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NewRelicConnectedPartnerResourceProperties(accountName, accountId, azureResourceId, location, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountName)) + { + builder.Append(" accountName: "); + if (AccountName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountName}'''"); + } + else + { + builder.AppendLine($"'{AccountName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountId)) + { + builder.Append(" accountId: "); + if (AccountId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountId}'''"); + } + else + { + builder.AppendLine($"'{AccountId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" azureResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AzureResourceId)) + { + builder.Append(" azureResourceId: "); + if (AzureResourceId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AzureResourceId}'''"); + } + else + { + builder.AppendLine($"'{AzureResourceId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NewRelicConnectedPartnerResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + NewRelicConnectedPartnerResourceProperties 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); + return DeserializeNewRelicConnectedPartnerResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NewRelicConnectedPartnerResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.cs similarity index 79% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.cs index a379cfa5948d0..db157cc54d225 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/ConnectedPartnerResourceProperties.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicConnectedPartnerResourceProperties.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// Connected Partner Resource Properties. - public partial class ConnectedPartnerResourceProperties + public partial class NewRelicConnectedPartnerResourceProperties { /// /// Keeps track of any properties unknown to the library. @@ -46,18 +46,18 @@ public partial class ConnectedPartnerResourceProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ConnectedPartnerResourceProperties() + /// Initializes a new instance of . + internal NewRelicConnectedPartnerResourceProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// NewRelic account name. /// NewRelic Account Id. /// The azure resource Id of the deployment. /// The location of the deployment. /// Keeps track of any properties unknown to the library. - internal ConnectedPartnerResourceProperties(string accountName, string accountId, string azureResourceId, AzureLocation? location, IDictionary serializedAdditionalRawData) + internal NewRelicConnectedPartnerResourceProperties(string accountName, string accountId, string azureResourceId, AzureLocation? location, IDictionary serializedAdditionalRawData) { AccountName = accountName; AccountId = accountId; @@ -67,12 +67,16 @@ internal ConnectedPartnerResourceProperties(string accountName, string accountId } /// NewRelic account name. + [WirePath("accountName")] public string AccountName { get; } /// NewRelic Account Id. + [WirePath("accountId")] public string AccountId { get; } /// The azure resource Id of the deployment. + [WirePath("azureResourceId")] public string AzureResourceId { get; } /// The location of the deployment. + [WirePath("location")] public AzureLocation? Location { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicHostsGetContent.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicHostsGetContent.cs index e12d579eb8c4a..299b39f08b8dd 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicHostsGetContent.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicHostsGetContent.cs @@ -74,8 +74,10 @@ internal NewRelicHostsGetContent() } /// VM resource IDs. + [WirePath("vmIds")] public IList VmIds { get; } /// User Email. + [WirePath("userEmail")] public string UserEmail { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsContent.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsContent.cs index 53a8112c4ad5f..8614eddb2737e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsContent.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsContent.cs @@ -70,6 +70,7 @@ internal NewRelicMetricsContent() } /// User Email. + [WirePath("userEmail")] public string UserEmail { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusContent.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusContent.cs index 2f34c60398c30..0b0ae3fe3a5c2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusContent.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusContent.cs @@ -73,8 +73,10 @@ internal NewRelicMetricsStatusContent() } /// Azure resource IDs. + [WirePath("azureResourceIds")] public IList AzureResourceIds { get; } /// User Email. + [WirePath("userEmail")] public string UserEmail { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.Serialization.cs index e0f32c468f124..615e3c2d28d32 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -102,6 +104,57 @@ internal static NewRelicMetricsStatusResult DeserializeNewRelicMetricsStatusResu return new NewRelicMetricsStatusResult(azureResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureResourceIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" azureResourceIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AzureResourceIds)) + { + if (AzureResourceIds.Any()) + { + builder.Append(" azureResourceIds: "); + builder.AppendLine("["); + foreach (var item in AzureResourceIds) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -110,6 +163,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicMetricsStatusResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.cs index 7b07be6da29c4..eec83f0e1a594 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMetricsStatusResult.cs @@ -61,6 +61,7 @@ internal NewRelicMetricsStatusResult(IReadOnlyList azureResourceIds, IDi } /// Azure resource IDs. + [WirePath("azureResourceIds")] public IReadOnlyList AzureResourceIds { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourceListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourceListResult.Serialization.cs index 4d4bea9364a0f..53fa3cc013d54 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourceListResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourceListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicMonitorResourceListResult DeserializeNewRelicMonitorReso return new NewRelicMonitorResourceListResult(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicMonitorResourceListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourcePatch.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourcePatch.cs index a1ff4947f82e9..6ee55d258c761 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourcePatch.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitorResourcePatch.cs @@ -74,18 +74,25 @@ internal NewRelicMonitorResourcePatch(ManagedServiceIdentity identity, IDictiona } /// The managed service identities assigned to this resource. + [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// Resource tags. + [WirePath("tags")] public IDictionary Tags { get; } /// MarketplaceSubscriptionStatus of the resource. + [WirePath("properties.newRelicAccountProperties")] public NewRelicAccountProperties NewRelicAccountProperties { get; set; } /// User Info. + [WirePath("properties.userInfo")] public NewRelicObservabilityUserInfo UserInfo { get; set; } /// Plan details. + [WirePath("properties.planData")] public NewRelicPlanDetails PlanData { get; set; } /// Source of org creation. + [WirePath("properties.orgCreationSource")] public NewRelicObservabilityOrgCreationSource? OrgCreationSource { get; set; } /// Source of account creation. + [WirePath("properties.accountCreationSource")] public NewRelicObservabilityAccountCreationSource? AccountCreationSource { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..3bcaec4743072 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + internal partial class NewRelicMonitoredResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NewRelicMonitoredResourceListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NewRelicMonitoredResourceListResult 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(NewRelicMonitoredResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNewRelicMonitoredResourceListResult(document.RootElement, options); + } + + internal static NewRelicMonitoredResourceListResult DeserializeNewRelicMonitoredResourceListResult(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(NewRelicResourceMonitorResult.DeserializeNewRelicResourceMonitorResult(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 NewRelicMonitoredResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NewRelicMonitoredResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + NewRelicMonitoredResourceListResult 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); + return DeserializeNewRelicMonitoredResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NewRelicMonitoredResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.cs similarity index 81% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.cs index 86b9c84c77cc8..10d013436cbc4 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredResourceListResult.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// List of all the resources being monitored by NewRelic monitor resource. - internal partial class NewRelicObservabilityMonitoredResourceListResult + internal partial class NewRelicMonitoredResourceListResult { /// /// Keeps track of any properties unknown to the library. @@ -46,29 +46,29 @@ internal partial class NewRelicObservabilityMonitoredResourceListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The MonitoredResource items on this page. /// is null. - internal NewRelicObservabilityMonitoredResourceListResult(IEnumerable value) + internal NewRelicMonitoredResourceListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); Value = value.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The MonitoredResource items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NewRelicObservabilityMonitoredResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NewRelicMonitoredResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal NewRelicObservabilityMonitoredResourceListResult() + /// Initializes a new instance of for deserialization. + internal NewRelicMonitoredResourceListResult() { } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.Serialization.cs new file mode 100644 index 0000000000000..e4291c2467617 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.Serialization.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + public partial class NewRelicMonitoredSubscriptionInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(TagRules)) + { + writer.WritePropertyName("tagRules"u8); + writer.WriteObjectValue(TagRules, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NewRelicMonitoredSubscriptionInfo 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(NewRelicMonitoredSubscriptionInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNewRelicMonitoredSubscriptionInfo(document.RootElement, options); + } + + internal static NewRelicMonitoredSubscriptionInfo DeserializeNewRelicMonitoredSubscriptionInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subscriptionId = default; + NewRelicMonitoringStatus? status = default; + string error = default; + NewRelicMonitoringTagRules tagRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new NewRelicMonitoringStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("tagRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tagRules = NewRelicMonitoringTagRules.DeserializeNewRelicMonitoringTagRules(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NewRelicMonitoredSubscriptionInfo(subscriptionId, status, error, tagRules, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubscriptionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subscriptionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SubscriptionId)) + { + builder.Append(" subscriptionId: "); + if (SubscriptionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SubscriptionId}'''"); + } + else + { + builder.AppendLine($"'{SubscriptionId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TagRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tagRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TagRules)) + { + builder.Append(" tagRules: "); + BicepSerializationHelpers.AppendChildObject(builder, TagRules, options, 2, false, " tagRules: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionInfo)} does not support writing '{options.Format}' format."); + } + } + + NewRelicMonitoredSubscriptionInfo 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); + return DeserializeNewRelicMonitoredSubscriptionInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.cs similarity index 77% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.cs index 99750a428f305..8c9c2a70ee416 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoredSubscription.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionInfo.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// The list of subscriptions and it's monitoring status by current NewRelic monitor. - public partial class MonitoredSubscription + public partial class NewRelicMonitoredSubscriptionInfo { /// /// Keeps track of any properties unknown to the library. @@ -45,18 +45,18 @@ public partial class MonitoredSubscription /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MonitoredSubscription() + /// Initializes a new instance of . + public NewRelicMonitoredSubscriptionInfo() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The subscriptionId to be monitored. /// The state of monitoring. /// The reason of not monitoring the subscription. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal MonitoredSubscription(string subscriptionId, Status? status, string error, MonitoringTagRulesProperties tagRules, IDictionary serializedAdditionalRawData) + internal NewRelicMonitoredSubscriptionInfo(string subscriptionId, NewRelicMonitoringStatus? status, string error, NewRelicMonitoringTagRules tagRules, IDictionary serializedAdditionalRawData) { SubscriptionId = subscriptionId; Status = status; @@ -66,12 +66,16 @@ internal MonitoredSubscription(string subscriptionId, Status? status, string err } /// The subscriptionId to be monitored. + [WirePath("subscriptionId")] public string SubscriptionId { get; set; } /// The state of monitoring. - public Status? Status { get; set; } + [WirePath("status")] + public NewRelicMonitoringStatus? Status { get; set; } /// The reason of not monitoring the subscription. + [WirePath("error")] public string Error { get; set; } /// The resource-specific properties for this resource. - public MonitoringTagRulesProperties TagRules { get; set; } + [WirePath("tagRules")] + public NewRelicMonitoringTagRules TagRules { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.Serialization.cs new file mode 100644 index 0000000000000..323cd8693ba80 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.Serialization.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + public partial class NewRelicMonitoredSubscriptionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchOperation)) + { + writer.WritePropertyName("patchOperation"u8); + writer.WriteStringValue(PatchOperation.Value.ToString()); + } + if (Optional.IsCollectionDefined(MonitoredSubscriptionList)) + { + writer.WritePropertyName("monitoredSubscriptionList"u8); + writer.WriteStartArray(); + foreach (var item in MonitoredSubscriptionList) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NewRelicMonitoredSubscriptionProperties 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(NewRelicMonitoredSubscriptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNewRelicMonitoredSubscriptionProperties(document.RootElement, options); + } + + internal static NewRelicMonitoredSubscriptionProperties DeserializeNewRelicMonitoredSubscriptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MonitoredSubscriptionPatchOperation? patchOperation = default; + IList monitoredSubscriptionList = default; + NewRelicProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchOperation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchOperation = new MonitoredSubscriptionPatchOperation(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoredSubscriptionList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NewRelicMonitoredSubscriptionInfo.DeserializeNewRelicMonitoredSubscriptionInfo(item, options)); + } + monitoredSubscriptionList = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NewRelicProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NewRelicMonitoredSubscriptionProperties(patchOperation, monitoredSubscriptionList ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchOperation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchOperation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchOperation)) + { + builder.Append(" patchOperation: "); + builder.AppendLine($"'{PatchOperation.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MonitoredSubscriptionList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" monitoredSubscriptionList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(MonitoredSubscriptionList)) + { + if (MonitoredSubscriptionList.Any()) + { + builder.Append(" monitoredSubscriptionList: "); + builder.AppendLine("["); + foreach (var item in MonitoredSubscriptionList) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " monitoredSubscriptionList: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionProperties)} does not support writing '{options.Format}' format."); + } + } + + NewRelicMonitoredSubscriptionProperties 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); + return DeserializeNewRelicMonitoredSubscriptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.cs similarity index 72% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.cs index e2294ad2b310c..9db29e15f3653 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoredSubscriptionProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. - public partial class SubscriptionList + public partial class NewRelicMonitoredSubscriptionProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,18 +45,18 @@ public partial class SubscriptionList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public SubscriptionList() + /// Initializes a new instance of . + public NewRelicMonitoredSubscriptionProperties() { - MonitoredSubscriptionList = new ChangeTrackingList(); + MonitoredSubscriptionList = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The operation for the patch on the resource. /// List of subscriptions and the state of the monitoring. /// Provisioning State of the resource. /// Keeps track of any properties unknown to the library. - internal SubscriptionList(PatchOperation? patchOperation, IList monitoredSubscriptionList, NewRelicProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal NewRelicMonitoredSubscriptionProperties(MonitoredSubscriptionPatchOperation? patchOperation, IList monitoredSubscriptionList, NewRelicProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { PatchOperation = patchOperation; MonitoredSubscriptionList = monitoredSubscriptionList; @@ -65,10 +65,13 @@ internal SubscriptionList(PatchOperation? patchOperation, IList The operation for the patch on the resource. - public PatchOperation? PatchOperation { get; set; } + [WirePath("patchOperation")] + public MonitoredSubscriptionPatchOperation? PatchOperation { get; set; } /// List of subscriptions and the state of the monitoring. - public IList MonitoredSubscriptionList { get; } + [WirePath("monitoredSubscriptionList")] + public IList MonitoredSubscriptionList { get; } /// Provisioning State of the resource. + [WirePath("provisioningState")] public NewRelicProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringStatus.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringStatus.cs new file mode 100644 index 0000000000000..9b36e0218fd49 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.NewRelicObservability.Models +{ + /// The state of monitoring. + public readonly partial struct NewRelicMonitoringStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NewRelicMonitoringStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InProgressValue = "InProgress"; + private const string ActiveValue = "Active"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + + /// InProgress. + public static NewRelicMonitoringStatus InProgress { get; } = new NewRelicMonitoringStatus(InProgressValue); + /// Active. + public static NewRelicMonitoringStatus Active { get; } = new NewRelicMonitoringStatus(ActiveValue); + /// Failed. + public static NewRelicMonitoringStatus Failed { get; } = new NewRelicMonitoringStatus(FailedValue); + /// Deleting. + public static NewRelicMonitoringStatus Deleting { get; } = new NewRelicMonitoringStatus(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(NewRelicMonitoringStatus left, NewRelicMonitoringStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NewRelicMonitoringStatus left, NewRelicMonitoringStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator NewRelicMonitoringStatus(string value) => new NewRelicMonitoringStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NewRelicMonitoringStatus other && Equals(other); + /// + public bool Equals(NewRelicMonitoringStatus 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringTagRules.Serialization.cs similarity index 50% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringTagRules.Serialization.cs index 91e11c110ac3a..92bbc6dc74e3b 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringTagRules.Serialization.cs @@ -8,21 +8,22 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; namespace Azure.ResourceManager.NewRelicObservability.Models { - public partial class MonitoringTagRulesProperties : IUtf8JsonSerializable, IJsonModel + public partial class NewRelicMonitoringTagRules : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoringTagRulesProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoringTagRules)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +60,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - MonitoringTagRulesProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NewRelicMonitoringTagRules IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoringTagRulesProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoringTagRules)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoringTagRulesProperties(document.RootElement, options); + return DeserializeNewRelicMonitoringTagRules(document.RootElement, options); } - internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static NewRelicMonitoringTagRules DeserializeNewRelicMonitoringTagRules(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -119,38 +120,100 @@ internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProper } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoringTagRulesProperties(provisioningState, logRules, metricRules, serializedAdditionalRawData); + return new NewRelicMonitoringTagRules(provisioningState, logRules, metricRules, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + private BinaryData SerializeBicep(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LogRules)) + { + builder.Append(" logRules: "); + BicepSerializationHelpers.AppendChildObject(builder, LogRules, options, 2, false, " logRules: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MetricRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metricRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MetricRules)) + { + builder.Append(" metricRules: "); + BicepSerializationHelpers.AppendChildObject(builder, MetricRules, options, 2, false, " metricRules: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(MonitoringTagRulesProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoringTagRules)} does not support writing '{options.Format}' format."); } } - MonitoringTagRulesProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NewRelicMonitoringTagRules IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoringTagRulesProperties(document.RootElement, options); + return DeserializeNewRelicMonitoringTagRules(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MonitoringTagRulesProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoringTagRules)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringTagRules.cs similarity index 81% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringTagRules.cs index fc200ffffe032..e27f2c656013a 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/MonitoringTagRulesProperties.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicMonitoringTagRules.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.NewRelicObservability.Models { /// The resource-specific properties for this resource. - public partial class MonitoringTagRulesProperties + public partial class NewRelicMonitoringTagRules { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class MonitoringTagRulesProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MonitoringTagRulesProperties() + /// Initializes a new instance of . + public NewRelicMonitoringTagRules() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Provisioning State of the resource. /// Set of rules for sending logs for the Monitor resource. /// Set of rules for sending metrics for the Monitor resource. /// Keeps track of any properties unknown to the library. - internal MonitoringTagRulesProperties(NewRelicProvisioningState? provisioningState, NewRelicObservabilityLogRules logRules, NewRelicObservabilityMetricRules metricRules, IDictionary serializedAdditionalRawData) + internal NewRelicMonitoringTagRules(NewRelicProvisioningState? provisioningState, NewRelicObservabilityLogRules logRules, NewRelicObservabilityMetricRules metricRules, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; LogRules = logRules; @@ -64,10 +64,13 @@ internal MonitoringTagRulesProperties(NewRelicProvisioningState? provisioningSta } /// Provisioning State of the resource. + [WirePath("provisioningState")] public NewRelicProvisioningState? ProvisioningState { get; } /// Set of rules for sending logs for the Monitor resource. + [WirePath("logRules")] public NewRelicObservabilityLogRules LogRules { get; set; } /// Set of rules for sending metrics for the Monitor resource. + [WirePath("metricRules")] public NewRelicObservabilityMetricRules MetricRules { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.Serialization.cs index 9c920ea371633..dcf13516d0765 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -114,6 +115,82 @@ internal static NewRelicObservabilityAccountInfo DeserializeNewRelicObservabilit return new NewRelicObservabilityAccountInfo(accountId, ingestionKey, region, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountId)) + { + builder.Append(" accountId: "); + if (AccountId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountId}'''"); + } + else + { + builder.AppendLine($"'{AccountId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IngestionKey), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingestionKey: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IngestionKey)) + { + builder.Append(" ingestionKey: "); + if (IngestionKey.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IngestionKey}'''"); + } + else + { + builder.AppendLine($"'{IngestionKey}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Region), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" region: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Region)) + { + builder.Append(" region: "); + builder.AppendLine($"'{Region.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +199,8 @@ BinaryData IPersistableModel.Write(ModelReader { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityAccountInfo)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs index f119907d32bb7..254c3ec8b0448 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAccountInfo.cs @@ -65,10 +65,13 @@ internal NewRelicObservabilityAccountInfo(string accountId, string ingestionKey, } /// Account id. + [WirePath("accountId")] public string AccountId { get; set; } /// ingestion key of account. + [WirePath("ingestionKey")] public string IngestionKey { get; set; } /// Region where New Relic account is present. + [WirePath("region")] public AzureLocation? Region { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.Serialization.cs index b8ba5a91deab9..3f8cb260f9447 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -114,6 +115,82 @@ internal static NewRelicObservabilityAppServiceInfo DeserializeNewRelicObservabi return new NewRelicObservabilityAppServiceInfo(azureResourceId, agentVersion, agentStatus, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" azureResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AzureResourceId)) + { + builder.Append(" azureResourceId: "); + builder.AppendLine($"'{AzureResourceId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentVersion)) + { + builder.Append(" agentVersion: "); + if (AgentVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AgentVersion}'''"); + } + else + { + builder.AppendLine($"'{AgentVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentStatus)) + { + builder.Append(" agentStatus: "); + if (AgentStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AgentStatus}'''"); + } + else + { + builder.AppendLine($"'{AgentStatus}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +199,8 @@ BinaryData IPersistableModel.Write(ModelRea { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityAppServiceInfo)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.cs index bc4bb89ac4c62..dea3393063e7b 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityAppServiceInfo.cs @@ -65,10 +65,13 @@ internal NewRelicObservabilityAppServiceInfo(ResourceIdentifier azureResourceId, } /// Azure App service resource ID. + [WirePath("azureResourceId")] public ResourceIdentifier AzureResourceId { get; } /// Version of the NewRelic agent installed on the App service. + [WirePath("agentVersion")] public string AgentVersion { get; } /// Status of the NewRelic agent installed on the App service. + [WirePath("agentStatus")] public string AgentStatus { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.Serialization.cs index 0754575fec770..5f7c585841662 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -114,6 +115,82 @@ internal static NewRelicObservabilityFilteringTag DeserializeNewRelicObservabili return new NewRelicObservabilityFilteringTag(name, value, action, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Action), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" action: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Action)) + { + builder.Append(" action: "); + builder.AppendLine($"'{Action.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +199,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityFilteringTag)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.cs index 8d0b44f66a858..04432e54ae61f 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityFilteringTag.cs @@ -64,10 +64,13 @@ internal NewRelicObservabilityFilteringTag(string name, string value, NewRelicOb } /// The name (also known as the key) of the tag. + [WirePath("name")] public string Name { get; set; } /// The value of the tag. + [WirePath("value")] public string Value { get; set; } /// Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [WirePath("action")] public NewRelicObservabilityTagAction? Action { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.Serialization.cs index bfc5e3211765d..14c74b2aad4d2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -147,6 +149,89 @@ internal static NewRelicObservabilityLogRules DeserializeNewRelicObservabilityLo return new NewRelicObservabilityLogRules(sendAadLogs, sendSubscriptionLogs, sendActivityLogs, filteringTags ?? new ChangeTrackingList(), serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SendAadLogs), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sendAadLogs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SendAadLogs)) + { + builder.Append(" sendAadLogs: "); + builder.AppendLine($"'{SendAadLogs.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SendSubscriptionLogs), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sendSubscriptionLogs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SendSubscriptionLogs)) + { + builder.Append(" sendSubscriptionLogs: "); + builder.AppendLine($"'{SendSubscriptionLogs.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SendActivityLogs), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sendActivityLogs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SendActivityLogs)) + { + builder.Append(" sendActivityLogs: "); + builder.AppendLine($"'{SendActivityLogs.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FilteringTags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" filteringTags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(FilteringTags)) + { + if (FilteringTags.Any()) + { + builder.Append(" filteringTags: "); + builder.AppendLine("["); + foreach (var item in FilteringTags) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " filteringTags: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -155,6 +240,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityLogRules)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.cs index 635435e3f6750..ca72c3329d223 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityLogRules.cs @@ -70,15 +70,19 @@ internal NewRelicObservabilityLogRules(NewRelicObservabilitySendAadLogsStatus? s } /// Flag specifying if AAD logs should be sent for the Monitor resource. + [WirePath("sendAadLogs")] public NewRelicObservabilitySendAadLogsStatus? SendAadLogs { get; set; } /// Flag specifying if subscription logs should be sent for the Monitor resource. + [WirePath("sendSubscriptionLogs")] public NewRelicObservabilitySendSubscriptionLogsStatus? SendSubscriptionLogs { get; set; } /// Flag specifying if activity logs from Azure resources should be sent for the Monitor resource. + [WirePath("sendActivityLogs")] public NewRelicObservabilitySendActivityLogsStatus? SendActivityLogs { get; set; } /// /// List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. /// If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. /// + [WirePath("filteringTags")] public IList FilteringTags { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.Serialization.cs index 5f9245d492047..570534a8b5dea 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -128,6 +130,82 @@ internal static NewRelicObservabilityMetricRules DeserializeNewRelicObservabilit return new NewRelicObservabilityMetricRules(sendMetrics, filteringTags ?? new ChangeTrackingList(), userEmail, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SendMetrics), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sendMetrics: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SendMetrics)) + { + builder.Append(" sendMetrics: "); + builder.AppendLine($"'{SendMetrics.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FilteringTags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" filteringTags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(FilteringTags)) + { + if (FilteringTags.Any()) + { + builder.Append(" filteringTags: "); + builder.AppendLine("["); + foreach (var item in FilteringTags) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " filteringTags: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UserEmail), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" userEmail: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UserEmail)) + { + builder.Append(" userEmail: "); + if (UserEmail.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UserEmail}'''"); + } + else + { + builder.AppendLine($"'{UserEmail}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -136,6 +214,8 @@ BinaryData IPersistableModel.Write(ModelReader { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityMetricRules)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.cs index ff627ca97c0de..6c26bff934627 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMetricRules.cs @@ -65,10 +65,13 @@ internal NewRelicObservabilityMetricRules(NewRelicObservabilitySendMetricsStatus } /// Flag specifying if metrics should be sent for the Monitor resource. + [WirePath("sendMetrics")] public NewRelicObservabilitySendMetricsStatus? SendMetrics { get; set; } /// List of filtering tags to be used for capturing metrics. + [WirePath("filteringTags")] public IList FilteringTags { get; } /// User Email. + [WirePath("userEmail")] public string UserEmail { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.Serialization.cs deleted file mode 100644 index 5cd9ff20dbfbb..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityMonitoredResourceListResult.Serialization.cs +++ /dev/null @@ -1,144 +0,0 @@ -// 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.NewRelicObservability.Models -{ - internal partial class NewRelicObservabilityMonitoredResourceListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NewRelicObservabilityMonitoredResourceListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NewRelicObservabilityMonitoredResourceListResult 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(NewRelicObservabilityMonitoredResourceListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNewRelicObservabilityMonitoredResourceListResult(document.RootElement, options); - } - - internal static NewRelicObservabilityMonitoredResourceListResult DeserializeNewRelicObservabilityMonitoredResourceListResult(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(NewRelicResourceMonitorResult.DeserializeNewRelicResourceMonitorResult(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 NewRelicObservabilityMonitoredResourceListResult(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(NewRelicObservabilityMonitoredResourceListResult)} does not support writing '{options.Format}' format."); - } - } - - NewRelicObservabilityMonitoredResourceListResult 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); - return DeserializeNewRelicObservabilityMonitoredResourceListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NewRelicObservabilityMonitoredResourceListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.Serialization.cs index b7c934457d0f2..6b3b46a1f2e5d 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -88,6 +89,44 @@ internal static NewRelicObservabilityOrganizationInfo DeserializeNewRelicObserva return new NewRelicObservabilityOrganizationInfo(organizationId, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrganizationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrganizationId)) + { + builder.Append(" organizationId: "); + if (OrganizationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OrganizationId}'''"); + } + else + { + builder.AppendLine($"'{OrganizationId}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -96,6 +135,8 @@ BinaryData IPersistableModel.Write(ModelR { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityOrganizationInfo)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.cs index d8cab0c77b322..754b43f8be202 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityOrganizationInfo.cs @@ -60,6 +60,7 @@ internal NewRelicObservabilityOrganizationInfo(string organizationId, IDictionar } /// Organization id. + [WirePath("organizationId")] public string OrganizationId { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRuleListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRuleListResult.Serialization.cs index d1a31c28690c3..20c899aab0ec6 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRuleListResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRuleListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicObservabilityTagRuleListResult DeserializeNewRelicObserv return new NewRelicObservabilityTagRuleListResult(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(Model { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityTagRuleListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRulePatch.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRulePatch.cs index f5949ae2bd089..168b72d91d0c2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRulePatch.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityTagRulePatch.cs @@ -62,8 +62,10 @@ internal NewRelicObservabilityTagRulePatch(NewRelicObservabilityLogRules logRule } /// Set of rules for sending logs for the Monitor resource. + [WirePath("properties.logRules")] public NewRelicObservabilityLogRules LogRules { get; set; } /// Set of rules for sending metrics for the Monitor resource. + [WirePath("properties.metricRules")] public NewRelicObservabilityMetricRules MetricRules { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.Serialization.cs index a91cb4a64d1df..778ec93690639 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -138,6 +139,136 @@ internal static NewRelicObservabilityUserInfo DeserializeNewRelicObservabilityUs serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FirstName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" firstName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FirstName)) + { + builder.Append(" firstName: "); + if (FirstName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FirstName}'''"); + } + else + { + builder.AppendLine($"'{FirstName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastName)) + { + builder.Append(" lastName: "); + if (LastName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastName}'''"); + } + else + { + builder.AppendLine($"'{LastName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EmailAddress), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" emailAddress: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EmailAddress)) + { + builder.Append(" emailAddress: "); + if (EmailAddress.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{EmailAddress}'''"); + } + else + { + builder.AppendLine($"'{EmailAddress}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhoneNumber), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" phoneNumber: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PhoneNumber)) + { + builder.Append(" phoneNumber: "); + if (PhoneNumber.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PhoneNumber}'''"); + } + else + { + builder.AppendLine($"'{PhoneNumber}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Country), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" country: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Country)) + { + builder.Append(" country: "); + if (Country.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Country}'''"); + } + else + { + builder.AppendLine($"'{Country}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -146,6 +277,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityUserInfo)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.cs index 87fb8e48d07d1..c2d3aceef037e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityUserInfo.cs @@ -68,14 +68,19 @@ internal NewRelicObservabilityUserInfo(string firstName, string lastName, string } /// First name. + [WirePath("firstName")] public string FirstName { get; set; } /// Last name. + [WirePath("lastName")] public string LastName { get; set; } /// User Email. + [WirePath("emailAddress")] public string EmailAddress { get; set; } /// Contact phone number. + [WirePath("phoneNumber")] public string PhoneNumber { get; set; } /// country if user. + [WirePath("country")] public string Country { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.Serialization.cs index f28d4c452abbc..dd62511fab620 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -88,6 +89,44 @@ internal static NewRelicObservabilityVmExtensionPayload DeserializeNewRelicObser return new NewRelicObservabilityVmExtensionPayload(ingestionKey, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IngestionKey), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingestionKey: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IngestionKey)) + { + builder.Append(" ingestionKey: "); + if (IngestionKey.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IngestionKey}'''"); + } + else + { + builder.AppendLine($"'{IngestionKey}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -96,6 +135,8 @@ BinaryData IPersistableModel.Write(Mode { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityVmExtensionPayload)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.cs index 768f721915ebf..2e45e937f3835 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmExtensionPayload.cs @@ -60,6 +60,7 @@ internal NewRelicObservabilityVmExtensionPayload(string ingestionKey, IDictionar } /// Ingestion key of the account. + [WirePath("ingestionKey")] public string IngestionKey { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmHostsListResponse.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmHostsListResponse.Serialization.cs index d111fdb2827ba..f5a0ad32eee8a 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmHostsListResponse.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmHostsListResponse.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicObservabilityVmHostsListResponse DeserializeNewRelicObse return new NewRelicObservabilityVmHostsListResponse(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(Mod { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityVmHostsListResponse)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.Serialization.cs index 64012a7a1a4fa..20abb24fd54d2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -114,6 +115,82 @@ internal static NewRelicObservabilityVmInfo DeserializeNewRelicObservabilityVmIn return new NewRelicObservabilityVmInfo(vmId, agentVersion, agentStatus, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmId)) + { + builder.Append(" vmId: "); + builder.AppendLine($"'{VmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentVersion)) + { + builder.Append(" agentVersion: "); + if (AgentVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AgentVersion}'''"); + } + else + { + builder.AppendLine($"'{AgentVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentStatus)) + { + builder.Append(" agentStatus: "); + if (AgentStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AgentStatus}'''"); + } + else + { + builder.AppendLine($"'{AgentStatus}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +199,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityVmInfo)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.cs index e853bb25487f6..3cf04b6012794 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicObservabilityVmInfo.cs @@ -65,10 +65,13 @@ internal NewRelicObservabilityVmInfo(ResourceIdentifier vmId, string agentVersio } /// Azure VM resource ID. + [WirePath("vmId")] public ResourceIdentifier VmId { get; } /// Version of the NewRelic agent installed on the VM. + [WirePath("agentVersion")] public string AgentVersion { get; } /// Status of the NewRelic agent installed on the VM. + [WirePath("agentStatus")] public string AgentStatus { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.Serialization.cs index 5647f3508e808..ff3c3f95519e3 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -186,6 +187,138 @@ internal static NewRelicOrganizationResourceData DeserializeNewRelicOrganization serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrganizationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrganizationId)) + { + builder.Append(" organizationId: "); + if (OrganizationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OrganizationId}'''"); + } + else + { + builder.AppendLine($"'{OrganizationId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrganizationName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrganizationName)) + { + builder.Append(" organizationName: "); + if (OrganizationName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OrganizationName}'''"); + } + else + { + builder.AppendLine($"'{OrganizationName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BillingSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" billingSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BillingSource)) + { + builder.Append(" billingSource: "); + builder.AppendLine($"'{BillingSource.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -194,6 +327,8 @@ BinaryData IPersistableModel.Write(ModelReader { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicOrganizationResourceData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.cs index 3176b40c0bba9..76835bc35a0f0 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationResourceData.cs @@ -70,10 +70,13 @@ internal NewRelicOrganizationResourceData(ResourceIdentifier id, string name, Re } /// organization id. + [WirePath("properties.organizationId")] public string OrganizationId { get; set; } /// organization name. + [WirePath("properties.organizationName")] public string OrganizationName { get; set; } /// Billing source. + [WirePath("properties.billingSource")] public NewRelicObservabilityBillingSource? BillingSource { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationsListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationsListResult.Serialization.cs index 31f48ec07b4e2..8312b302ff3ae 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationsListResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicOrganizationsListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicOrganizationsListResult DeserializeNewRelicOrganizations return new NewRelicOrganizationsListResult(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(ModelReaderW { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicOrganizationsListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.Serialization.cs index bee0569d80f6c..99ebe67f19bb1 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -194,6 +195,122 @@ internal static NewRelicPlanData DeserializeNewRelicPlanData(JsonElement element serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PlanData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" planData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PlanData)) + { + builder.Append(" planData: "); + BicepSerializationHelpers.AppendChildObject(builder, PlanData, options, 4, false, " planData: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrgCreationSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" orgCreationSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrgCreationSource)) + { + builder.Append(" orgCreationSource: "); + builder.AppendLine($"'{OrgCreationSource.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountCreationSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountCreationSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountCreationSource)) + { + builder.Append(" accountCreationSource: "); + builder.AppendLine($"'{AccountCreationSource.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -202,6 +319,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions op { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicPlanData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.cs index c20af10240468..42852478a5336 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanData.cs @@ -70,10 +70,13 @@ internal NewRelicPlanData(ResourceIdentifier id, string name, ResourceType resou } /// Plan details. + [WirePath("properties.planData")] public NewRelicPlanDetails PlanData { get; set; } /// Source of org creation. + [WirePath("properties.orgCreationSource")] public NewRelicObservabilityOrgCreationSource? OrgCreationSource { get; set; } /// Source of account creation. + [WirePath("properties.accountCreationSource")] public NewRelicObservabilityAccountCreationSource? AccountCreationSource { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDataListResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDataListResult.Serialization.cs index 4c6bfedb81d96..1c4883899efb9 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDataListResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDataListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -110,6 +112,59 @@ internal static NewRelicPlanDataListResult DeserializeNewRelicPlanDataListResult return new NewRelicPlanDataListResult(value, nextLink, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -118,6 +173,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicPlanDataListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs index 21089cf0c0a20..4f3afbe1ef77f 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -31,10 +32,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("usageType"u8); writer.WriteStringValue(UsageType.Value.ToString()); } - if (Optional.IsDefined(BillingCycle)) + if (Optional.IsDefined(NewRelicPlanBillingCycle)) { writer.WritePropertyName("billingCycle"u8); - writer.WriteStringValue(BillingCycle); + writer.WriteStringValue(NewRelicPlanBillingCycle); } if (Optional.IsDefined(PlanDetails)) { @@ -129,6 +130,98 @@ internal static NewRelicPlanDetails DeserializeNewRelicPlanDetails(JsonElement e return new NewRelicPlanDetails(usageType, billingCycle, planDetails, effectiveDate, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UsageType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" usageType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UsageType)) + { + builder.Append(" usageType: "); + builder.AppendLine($"'{UsageType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NewRelicPlanBillingCycle), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" billingCycle: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NewRelicPlanBillingCycle)) + { + builder.Append(" billingCycle: "); + if (NewRelicPlanBillingCycle.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NewRelicPlanBillingCycle}'''"); + } + else + { + builder.AppendLine($"'{NewRelicPlanBillingCycle}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PlanDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" planDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PlanDetails)) + { + builder.Append(" planDetails: "); + if (PlanDetails.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PlanDetails}'''"); + } + else + { + builder.AppendLine($"'{PlanDetails}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EffectiveOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" effectiveDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EffectiveOn)) + { + builder.Append(" effectiveDate: "); + var formattedDateTimeString = TypeFormatters.ToString(EffectiveOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -137,6 +230,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicPlanDetails)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs index b0f2f08ee68a2..e542be5caaa1d 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicPlanDetails.cs @@ -52,26 +52,30 @@ public NewRelicPlanDetails() /// Initializes a new instance of . /// Different usage type like PAYG/COMMITTED. this could be enum. - /// Different billing cycles like Monthly/Weekly. + /// Different billing cycles like Monthly/Weekly. /// plan id as published by NewRelic. /// date when plan was applied. /// Keeps track of any properties unknown to the library. - internal NewRelicPlanDetails(NewRelicObservabilityUsageType? usageType, string billingCycle, string planDetails, DateTimeOffset? effectiveOn, IDictionary serializedAdditionalRawData) + internal NewRelicPlanDetails(NewRelicObservabilityUsageType? usageType, string newRelicPlanBillingCycle, string planDetails, DateTimeOffset? effectiveOn, IDictionary serializedAdditionalRawData) { UsageType = usageType; - BillingCycle = billingCycle; + NewRelicPlanBillingCycle = newRelicPlanBillingCycle; PlanDetails = planDetails; EffectiveOn = effectiveOn; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Different usage type like PAYG/COMMITTED. this could be enum. + [WirePath("usageType")] public NewRelicObservabilityUsageType? UsageType { get; set; } /// Different billing cycles like Monthly/Weekly. - public string BillingCycle { get; set; } + [WirePath("billingCycle")] + public string NewRelicPlanBillingCycle { get; set; } /// plan id as published by NewRelic. + [WirePath("planDetails")] public string PlanDetails { get; set; } /// date when plan was applied. + [WirePath("effectiveDate")] public DateTimeOffset? EffectiveOn { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.Serialization.cs index 57fc38a2d343a..60d1c5559ac23 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -150,6 +151,112 @@ internal static NewRelicResourceMonitorResult DeserializeNewRelicResourceMonitor serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SendingMetrics), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sendingMetrics: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SendingMetrics)) + { + builder.Append(" sendingMetrics: "); + builder.AppendLine($"'{SendingMetrics.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ReasonForMetricsStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" reasonForMetricsStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ReasonForMetricsStatus)) + { + builder.Append(" reasonForMetricsStatus: "); + if (ReasonForMetricsStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ReasonForMetricsStatus}'''"); + } + else + { + builder.AppendLine($"'{ReasonForMetricsStatus}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SendingLogs), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sendingLogs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SendingLogs)) + { + builder.Append(" sendingLogs: "); + builder.AppendLine($"'{SendingLogs.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ReasonForLogsStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" reasonForLogsStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ReasonForLogsStatus)) + { + builder.Append(" reasonForLogsStatus: "); + if (ReasonForLogsStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ReasonForLogsStatus}'''"); + } + else + { + builder.AppendLine($"'{ReasonForLogsStatus}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -158,6 +265,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicResourceMonitorResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.cs index 5124cb5ffdf26..8070764e7dd4e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicResourceMonitorResult.cs @@ -69,14 +69,19 @@ internal NewRelicResourceMonitorResult(ResourceIdentifier id, NewRelicObservabil } /// The ARM id of the resource. + [WirePath("id")] public ResourceIdentifier Id { get; } /// Flag indicating if resource is sending metrics to NewRelic. + [WirePath("sendingMetrics")] public NewRelicObservabilitySendingMetricsStatus? SendingMetrics { get; } /// Reason for why the resource is sending metrics (or why it is not sending). + [WirePath("reasonForMetricsStatus")] public string ReasonForMetricsStatus { get; } /// Flag indicating if resource is sending logs to NewRelic. + [WirePath("sendingLogs")] public NewRelicObservabilitySendingLogsStatus? SendingLogs { get; } /// Reason for why the resource is sending logs (or why it is not sending). + [WirePath("reasonForLogsStatus")] public string ReasonForLogsStatus { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.Serialization.cs index e49a1144a0b47..241fe8960df01 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -133,6 +134,89 @@ internal static NewRelicSingleSignOnProperties DeserializeNewRelicSingleSignOnPr return new NewRelicSingleSignOnProperties(singleSignOnState, enterpriseAppId, singleSignOnUrl, provisioningState, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SingleSignOnState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" singleSignOnState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SingleSignOnState)) + { + builder.Append(" singleSignOnState: "); + builder.AppendLine($"'{SingleSignOnState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnterpriseAppId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enterpriseAppId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnterpriseAppId)) + { + builder.Append(" enterpriseAppId: "); + if (EnterpriseAppId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{EnterpriseAppId}'''"); + } + else + { + builder.AppendLine($"'{EnterpriseAppId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SingleSignOnUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" singleSignOnUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SingleSignOnUri)) + { + builder.Append(" singleSignOnUrl: "); + builder.AppendLine($"'{SingleSignOnUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -141,6 +225,8 @@ BinaryData IPersistableModel.Write(ModelReaderWr { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicSingleSignOnProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.cs index a171457697c03..b7a3f513b6203 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSingleSignOnProperties.cs @@ -66,12 +66,16 @@ internal NewRelicSingleSignOnProperties(NewRelicSingleSignOnState? singleSignOnS } /// Single sign-on state. + [WirePath("singleSignOnState")] public NewRelicSingleSignOnState? SingleSignOnState { get; set; } /// The Id of the Enterprise App used for Single sign-on. + [WirePath("enterpriseAppId")] public string EnterpriseAppId { get; set; } /// The login URL specific to this NewRelic Organization. + [WirePath("singleSignOnUrl")] public Uri SingleSignOnUri { get; set; } /// Provisioning state. + [WirePath("provisioningState")] public NewRelicProvisioningState? ProvisioningState { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSwitchBillingContent.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSwitchBillingContent.cs index 60d347de1514e..bc7fe8ccfffd6 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSwitchBillingContent.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/NewRelicSwitchBillingContent.cs @@ -77,12 +77,16 @@ internal NewRelicSwitchBillingContent() } /// Azure resource Id. + [WirePath("azureResourceId")] public ResourceIdentifier AzureResourceId { get; set; } /// Organization id. + [WirePath("organizationId")] public string OrganizationId { get; set; } /// Plan details. + [WirePath("planData")] public NewRelicPlanDetails PlanData { get; set; } /// User Email. + [WirePath("userEmail")] public string UserEmail { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs index fcc2b29ef997c..5f59b8fca81ba 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -99,6 +100,67 @@ internal static PartnerBillingEntity DeserializePartnerBillingEntity(JsonElement return new PartnerBillingEntity(organizationId, organizationName, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrganizationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrganizationId)) + { + builder.Append(" organizationId: "); + if (OrganizationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OrganizationId}'''"); + } + else + { + builder.AppendLine($"'{OrganizationId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrganizationName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" organizationName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrganizationName)) + { + builder.Append(" organizationName: "); + if (OrganizationName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OrganizationName}'''"); + } + else + { + builder.AppendLine($"'{OrganizationName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -107,6 +169,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(PartnerBillingEntity)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs index 7bc858f51af37..51c56a64c2419 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PartnerBillingEntity.cs @@ -62,8 +62,10 @@ internal PartnerBillingEntity(string organizationId, string organizationName, ID } /// The New Relic Organization Id. + [WirePath("organizationId")] public string OrganizationId { get; } /// The New Relic Organization Name. + [WirePath("organizationName")] public string OrganizationName { get; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs deleted file mode 100644 index 330eef1b0a856..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/PatchOperation.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.NewRelicObservability.Models -{ - /// The operation for the patch on the resource. - public readonly partial struct PatchOperation : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PatchOperation(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AddBeginValue = "AddBegin"; - private const string AddCompleteValue = "AddComplete"; - private const string DeleteBeginValue = "DeleteBegin"; - private const string DeleteCompleteValue = "DeleteComplete"; - private const string ActiveValue = "Active"; - - /// AddBegin. - public static PatchOperation AddBegin { get; } = new PatchOperation(AddBeginValue); - /// AddComplete. - public static PatchOperation AddComplete { get; } = new PatchOperation(AddCompleteValue); - /// DeleteBegin. - public static PatchOperation DeleteBegin { get; } = new PatchOperation(DeleteBeginValue); - /// DeleteComplete. - public static PatchOperation DeleteComplete { get; } = new PatchOperation(DeleteCompleteValue); - /// Active. - public static PatchOperation Active { get; } = new PatchOperation(ActiveValue); - /// Determines if two values are the same. - public static bool operator ==(PatchOperation left, PatchOperation right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PatchOperation left, PatchOperation right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PatchOperation(string value) => new PatchOperation(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PatchOperation other && Equals(other); - /// - public bool Equals(PatchOperation 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs deleted file mode 100644 index 337286c47be4d..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/Status.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.NewRelicObservability.Models -{ - /// The state of monitoring. - public readonly partial struct Status : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Status(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InProgressValue = "InProgress"; - private const string ActiveValue = "Active"; - private const string FailedValue = "Failed"; - private const string DeletingValue = "Deleting"; - - /// InProgress. - public static Status InProgress { get; } = new Status(InProgressValue); - /// Active. - public static Status Active { get; } = new Status(ActiveValue); - /// Failed. - public static Status Failed { get; } = new Status(FailedValue); - /// Deleting. - public static Status Deleting { get; } = new Status(DeletingValue); - /// Determines if two values are the same. - public static bool operator ==(Status left, Status right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Status left, Status right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Status(string value) => new Status(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Status other && Equals(other); - /// - public bool Equals(Status 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/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs deleted file mode 100644 index 2c39a14343de4..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Models/SubscriptionList.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// 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.NewRelicObservability.Models -{ - public partial class SubscriptionList : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SubscriptionList)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(PatchOperation)) - { - writer.WritePropertyName("patchOperation"u8); - writer.WriteStringValue(PatchOperation.Value.ToString()); - } - if (Optional.IsCollectionDefined(MonitoredSubscriptionList)) - { - writer.WritePropertyName("monitoredSubscriptionList"u8); - writer.WriteStartArray(); - foreach (var item in MonitoredSubscriptionList) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && _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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - SubscriptionList 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(SubscriptionList)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSubscriptionList(document.RootElement, options); - } - - internal static SubscriptionList DeserializeSubscriptionList(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - PatchOperation? patchOperation = default; - IList monitoredSubscriptionList = default; - NewRelicProvisioningState? provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("patchOperation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - patchOperation = new PatchOperation(property.Value.GetString()); - continue; - } - if (property.NameEquals("monitoredSubscriptionList"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MonitoredSubscription.DeserializeMonitoredSubscription(item, options)); - } - monitoredSubscriptionList = array; - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NewRelicProvisioningState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SubscriptionList(patchOperation, monitoredSubscriptionList ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SubscriptionList)} does not support writing '{options.Format}' format."); - } - } - - SubscriptionList 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); - return DeserializeSubscriptionList(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SubscriptionList)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs deleted file mode 100644 index 21032c812268e..0000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.NewRelicObservability -{ - public partial class MonitoredSubscriptionPropertyResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - MonitoredSubscriptionPropertyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - MonitoredSubscriptionPropertyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs index eb87b57427075..b77d91546178e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs @@ -170,11 +170,11 @@ public virtual Response GetNewRelicObserva return GetNewRelicObservabilityTagRules().Get(ruleSetName, cancellationToken); } - /// Gets a collection of MonitoredSubscriptionPropertyResources in the NewRelicMonitorResource. - /// An object representing collection of MonitoredSubscriptionPropertyResources and their operations over a MonitoredSubscriptionPropertyResource. - public virtual MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionProperties() + /// Gets a collection of NewRelicMonitoredSubscriptionResources in the NewRelicMonitorResource. + /// An object representing collection of NewRelicMonitoredSubscriptionResources and their operations over a NewRelicMonitoredSubscriptionResource. + public virtual NewRelicMonitoredSubscriptionCollection GetNewRelicMonitoredSubscriptions() { - return GetCachedClient(client => new MonitoredSubscriptionPropertyCollection(client, Id)); + return GetCachedClient(client => new NewRelicMonitoredSubscriptionCollection(client, Id)); } /// @@ -194,16 +194,16 @@ public virtual MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionP /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. [ForwardsClientCalls] - public virtual async Task> GetMonitoredSubscriptionPropertyAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual async Task> GetNewRelicMonitoredSubscriptionAsync(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - return await GetMonitoredSubscriptionProperties().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); + return await GetNewRelicMonitoredSubscriptions().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); } /// @@ -223,16 +223,16 @@ public virtual async Task> GetMo /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. [ForwardsClientCalls] - public virtual Response GetMonitoredSubscriptionProperty(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual Response GetNewRelicMonitoredSubscription(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - return GetMonitoredSubscriptionProperties().Get(configurationName, cancellationToken); + return GetNewRelicMonitoredSubscriptions().Get(configurationName, cancellationToken); } /// @@ -407,50 +407,6 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string userEmail, Cancel } } - /// - /// Update a NewRelicMonitorResource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName} - /// - /// - /// Operation Id - /// Monitors_Update - /// - /// - /// Default Api Version - /// 2024-03-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource properties to be updated. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(NewRelicMonitorResourcePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _newRelicMonitorResourceMonitorsClientDiagnostics.CreateScope("NewRelicMonitorResource.Update"); - scope.Start(); - try - { - var response = await _newRelicMonitorResourceMonitorsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitorResourceOperationSource(Client), _newRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, _newRelicMonitorResourceMonitorsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - var finalResponse = await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return Response.FromValue(finalResponse.Value, finalResponse.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Update a NewRelicMonitorResource /// @@ -1145,7 +1101,7 @@ public virtual Response VmHostPayload(C /// /// /// The cancellation token to use. - public virtual async Task> GetBillingInfoAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetBillingInfoAsync(CancellationToken cancellationToken = default) { using var scope = _billingInfoClientDiagnostics.CreateScope("NewRelicMonitorResource.GetBillingInfo"); scope.Start(); @@ -1179,7 +1135,7 @@ public virtual async Task> GetBillingInfoAsync(Cance /// /// /// The cancellation token to use. - public virtual Response GetBillingInfo(CancellationToken cancellationToken = default) + public virtual Response GetBillingInfo(CancellationToken cancellationToken = default) { using var scope = _billingInfoClientDiagnostics.CreateScope("NewRelicMonitorResource.GetBillingInfo"); scope.Start(); @@ -1214,12 +1170,12 @@ public virtual Response GetBillingInfo(CancellationToken canc /// /// Email Id of the user. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConnectedPartnerResourcesAsync(string body = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetConnectedPartnerResourcesAsync(string body = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedPartnerResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedPartnerResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ConnectedPartnerResourcesListFormat.DeserializeConnectedPartnerResourcesListFormat(e), _connectedPartnerResourcesClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetConnectedPartnerResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NewRelicConnectedPartnerResourceInfo.DeserializeNewRelicConnectedPartnerResourceInfo(e), _connectedPartnerResourcesClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetConnectedPartnerResources", "value", "nextLink", cancellationToken); } /// @@ -1241,12 +1197,12 @@ public virtual AsyncPageable GetConnectedPa /// /// Email Id of the user. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConnectedPartnerResources(string body = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetConnectedPartnerResources(string body = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedPartnerResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedPartnerResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ConnectedPartnerResourcesListFormat.DeserializeConnectedPartnerResourcesListFormat(e), _connectedPartnerResourcesClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetConnectedPartnerResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NewRelicConnectedPartnerResourceInfo.DeserializeNewRelicConnectedPartnerResourceInfo(e), _connectedPartnerResourcesClientDiagnostics, Pipeline, "NewRelicMonitorResource.GetConnectedPartnerResources", "value", "nextLink", cancellationToken); } /// diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs index 88e6dda81603b..f1d5ae782134f 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -395,6 +397,360 @@ internal static NewRelicMonitorResourceData DeserializeNewRelicMonitorResourceDa serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MonitoringStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" monitoringStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MonitoringStatus)) + { + builder.Append(" monitoringStatus: "); + builder.AppendLine($"'{MonitoringStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceSubscriptionStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceSubscriptionStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceSubscriptionStatus)) + { + builder.Append(" marketplaceSubscriptionStatus: "); + builder.AppendLine($"'{MarketplaceSubscriptionStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceSubscriptionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceSubscriptionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + builder.Append(" marketplaceSubscriptionId: "); + if (MarketplaceSubscriptionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MarketplaceSubscriptionId}'''"); + } + else + { + builder.AppendLine($"'{MarketplaceSubscriptionId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NewRelicAccountProperties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" newRelicAccountProperties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NewRelicAccountProperties)) + { + builder.Append(" newRelicAccountProperties: "); + BicepSerializationHelpers.AppendChildObject(builder, NewRelicAccountProperties, options, 4, false, " newRelicAccountProperties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UserInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" userInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UserInfo)) + { + builder.Append(" userInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, UserInfo, options, 4, false, " userInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PlanData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" planData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PlanData)) + { + builder.Append(" planData: "); + BicepSerializationHelpers.AppendChildObject(builder, PlanData, options, 4, false, " planData: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LiftrResourceCategory), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" liftrResourceCategory: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LiftrResourceCategory)) + { + builder.Append(" liftrResourceCategory: "); + builder.AppendLine($"'{LiftrResourceCategory.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LiftrResourcePreference), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" liftrResourcePreference: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LiftrResourcePreference)) + { + builder.Append(" liftrResourcePreference: "); + builder.AppendLine($"{LiftrResourcePreference.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OrgCreationSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" orgCreationSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OrgCreationSource)) + { + builder.Append(" orgCreationSource: "); + builder.AppendLine($"'{OrgCreationSource.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountCreationSource), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountCreationSource: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountCreationSource)) + { + builder.Append(" accountCreationSource: "); + builder.AppendLine($"'{AccountCreationSource.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubscriptionState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subscriptionState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SubscriptionState)) + { + builder.Append(" subscriptionState: "); + if (SubscriptionState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SubscriptionState}'''"); + } + else + { + builder.AppendLine($"'{SubscriptionState}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SaaSAzureSubscriptionStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" saaSAzureSubscriptionStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SaaSAzureSubscriptionStatus)) + { + builder.Append(" saaSAzureSubscriptionStatus: "); + if (SaaSAzureSubscriptionStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SaaSAzureSubscriptionStatus}'''"); + } + else + { + builder.AppendLine($"'{SaaSAzureSubscriptionStatus}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -403,6 +759,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicMonitorResourceData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs index 00377a86293a1..3becd5235266d 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResourceData.cs @@ -104,32 +104,46 @@ internal NewRelicMonitorResourceData() } /// The managed service identities assigned to this resource. + [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// Provisioning State of the resource. + [WirePath("properties.provisioningState")] public NewRelicProvisioningState? ProvisioningState { get; } /// MonitoringStatus of the resource. + [WirePath("properties.monitoringStatus")] public NewRelicObservabilityMonitoringStatus? MonitoringStatus { get; } /// NewRelic Organization properties of the resource. + [WirePath("properties.marketplaceSubscriptionStatus")] public NewRelicObservabilityMarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } /// Marketplace Subscription Id. + [WirePath("properties.marketplaceSubscriptionId")] public string MarketplaceSubscriptionId { get; } /// MarketplaceSubscriptionStatus of the resource. + [WirePath("properties.newRelicAccountProperties")] public NewRelicAccountProperties NewRelicAccountProperties { get; set; } /// User Info. + [WirePath("properties.userInfo")] public NewRelicObservabilityUserInfo UserInfo { get; set; } /// Plan details. + [WirePath("properties.planData")] public NewRelicPlanDetails PlanData { get; set; } /// Liftr resource category. + [WirePath("properties.liftrResourceCategory")] public NewRelicLiftrResourceCategory? LiftrResourceCategory { get; } /// Liftr resource preference. The priority of the resource. + [WirePath("properties.liftrResourcePreference")] public int? LiftrResourcePreference { get; } /// Source of org creation. + [WirePath("properties.orgCreationSource")] public NewRelicObservabilityOrgCreationSource? OrgCreationSource { get; set; } /// Source of account creation. + [WirePath("properties.accountCreationSource")] public NewRelicObservabilityAccountCreationSource? AccountCreationSource { get; set; } /// State of the Azure Subscription containing the monitor resource. + [WirePath("properties.subscriptionState")] public string SubscriptionState { get; set; } /// Status of Azure Subscription where Marketplace SaaS is located. + [WirePath("properties.saaSAzureSubscriptionStatus")] public string SaaSAzureSubscriptionStatus { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionCollection.cs similarity index 66% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionCollection.cs index 8a27eb400bfc0..9cb75db43db90 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyCollection.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionCollection.cs @@ -19,28 +19,28 @@ namespace Azure.ResourceManager.NewRelicObservability { /// - /// 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 GetMonitoredSubscriptionProperties method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNewRelicMonitoredSubscriptions method from an instance of . /// - public partial class MonitoredSubscriptionPropertyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class NewRelicMonitoredSubscriptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics; - private readonly MonitoredSubscriptionsRestOperations _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient; + private readonly ClientDiagnostics _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics; + private readonly MonitoredSubscriptionsRestOperations _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient; - /// Initializes a new instance of the class for mocking. - protected MonitoredSubscriptionPropertyCollection() + /// Initializes a new instance of the class for mocking. + protected NewRelicMonitoredSubscriptionCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal MonitoredSubscriptionPropertyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NewRelicMonitoredSubscriptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", MonitoredSubscriptionPropertyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MonitoredSubscriptionPropertyResource.ResourceType, out string monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); - _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); + _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", NewRelicMonitoredSubscriptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NewRelicMonitoredSubscriptionResource.ResourceType, out string newRelicMonitoredSubscriptionMonitoredSubscriptionsApiVersion); + _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, newRelicMonitoredSubscriptionMonitoredSubscriptionsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -69,25 +69,25 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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 configuration name. Only 'default' value is supported. - /// The to use. + /// The to use. /// The cancellation token to use. /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.CreateOrUpdate"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken).ConfigureAwait(false); - var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitoredSubscriptionOperationSource(Client), _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -116,25 +116,25 @@ public virtual async Task> C /// /// /// 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 configuration name. Only 'default' value is supported. - /// The to use. + /// The to use. /// The cancellation token to use. /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.CreateOrUpdate"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.CreateOrUpdate"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken); - var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitoredSubscriptionOperationSource(Client), _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -163,22 +163,22 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. - public virtual async Task> GetAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Get"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.Get"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NewRelicMonitoredSubscriptionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -204,22 +204,22 @@ public virtual async Task> GetAs /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. - public virtual Response Get(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual Response Get(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Get"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.Get"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NewRelicMonitoredSubscriptionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -245,17 +245,17 @@ public virtual Response Get(Configuration /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MonitoredSubscriptionPropertyResource(Client, MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(e)), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, "MonitoredSubscriptionPropertyCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NewRelicMonitoredSubscriptionResource(Client, NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(e)), _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, "NewRelicMonitoredSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -275,17 +275,17 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitoredSubscriptionPropertyResource(Client, MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(e)), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, "MonitoredSubscriptionPropertyCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NewRelicMonitoredSubscriptionResource(Client, NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(e)), _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, "NewRelicMonitoredSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -305,19 +305,19 @@ public virtual Pageable GetAll(Cancellati /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. - public virtual async Task> ExistsAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual async Task> ExistsAsync(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Exists"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.Exists"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -344,19 +344,19 @@ public virtual async Task> ExistsAsync(ConfigurationName configur /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. - public virtual Response Exists(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual Response Exists(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.Exists"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.Exists"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -383,22 +383,22 @@ public virtual Response Exists(ConfigurationName configurationName, Cancel /// /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. - public virtual async Task> GetIfExistsAsync(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.GetIfExists"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.GetIfExists"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NewRelicMonitoredSubscriptionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -424,22 +424,22 @@ public virtual async Task /// /// Resource - /// + /// /// /// /// /// The configuration name. Only 'default' value is supported. /// The cancellation token to use. - public virtual NullableResponse GetIfExists(ConfigurationName configurationName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyCollection.GetIfExists"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionCollection.GetIfExists"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NewRelicMonitoredSubscriptionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -448,7 +448,7 @@ public virtual NullableResponse GetIfExis } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -458,7 +458,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionData.Serialization.cs similarity index 53% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionData.Serialization.cs index dce2eeeacb7f7..f2ffedd8d89d4 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -15,16 +16,16 @@ namespace Azure.ResourceManager.NewRelicObservability { - public partial class MonitoredSubscriptionPropertyData : IUtf8JsonSerializable, IJsonModel + public partial class NewRelicMonitoredSubscriptionData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -71,19 +72,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - MonitoredSubscriptionPropertyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NewRelicMonitoredSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoredSubscriptionPropertyData(document.RootElement, options); + return DeserializeNewRelicMonitoredSubscriptionData(document.RootElement, options); } - internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscriptionPropertyData(JsonElement element, ModelReaderWriterOptions options = null) + internal static NewRelicMonitoredSubscriptionData DeserializeNewRelicMonitoredSubscriptionData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,7 +92,7 @@ internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscripti { return null; } - SubscriptionList properties = default; + NewRelicMonitoredSubscriptionProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -106,7 +107,7 @@ internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscripti { continue; } - properties = SubscriptionList.DeserializeSubscriptionList(property.Value, options); + properties = NewRelicMonitoredSubscriptionProperties.DeserializeNewRelicMonitoredSubscriptionProperties(property.Value, options); continue; } if (property.NameEquals("id"u8)) @@ -139,7 +140,7 @@ internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscripti } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoredSubscriptionPropertyData( + return new NewRelicMonitoredSubscriptionData( id, name, type, @@ -148,35 +149,120 @@ internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscripti serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + private BinaryData SerializeBicep(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionData)} does not support writing '{options.Format}' format."); } } - MonitoredSubscriptionPropertyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NewRelicMonitoredSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMonitoredSubscriptionPropertyData(document.RootElement, options); + return DeserializeNewRelicMonitoredSubscriptionData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NewRelicMonitoredSubscriptionData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionData.cs similarity index 78% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionData.cs index de4addd2098f5..8f795fba11ae4 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.NewRelicObservability { /// - /// A class representing the MonitoredSubscriptionProperty data model. + /// A class representing the NewRelicMonitoredSubscription data model. /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. /// - public partial class MonitoredSubscriptionPropertyData : ResourceData + public partial class NewRelicMonitoredSubscriptionData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,25 +51,26 @@ public partial class MonitoredSubscriptionPropertyData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MonitoredSubscriptionPropertyData() + /// Initializes a new instance of . + public NewRelicMonitoredSubscriptionData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. /// Keeps track of any properties unknown to the library. - internal MonitoredSubscriptionPropertyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubscriptionList properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NewRelicMonitoredSubscriptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NewRelicMonitoredSubscriptionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The request to update subscriptions needed to be monitored by the NewRelic monitor resource. - public SubscriptionList Properties { get; set; } + [WirePath("properties")] + public NewRelicMonitoredSubscriptionProperties Properties { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.Serialization.cs new file mode 100644 index 0000000000000..2799528c027e2 --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.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.NewRelicObservability +{ + public partial class NewRelicMonitoredSubscriptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NewRelicMonitoredSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + NewRelicMonitoredSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.cs similarity index 73% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.cs index 986dc5b3e5fb4..430e8197493c1 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/MonitoredSubscriptionPropertyResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitoredSubscriptionResource.cs @@ -16,53 +16,53 @@ namespace Azure.ResourceManager.NewRelicObservability { /// - /// A Class representing a MonitoredSubscriptionProperty 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 GetMonitoredSubscriptionPropertyResource method. - /// Otherwise you can get one from its parent resource using the GetMonitoredSubscriptionProperty method. + /// A Class representing a NewRelicMonitoredSubscription 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 GetNewRelicMonitoredSubscriptionResource method. + /// Otherwise you can get one from its parent resource using the GetNewRelicMonitoredSubscription method. /// - public partial class MonitoredSubscriptionPropertyResource : ArmResource + public partial class NewRelicMonitoredSubscriptionResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The monitorName. /// The configurationName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics; - private readonly MonitoredSubscriptionsRestOperations _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient; - private readonly MonitoredSubscriptionPropertyData _data; + private readonly ClientDiagnostics _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics; + private readonly MonitoredSubscriptionsRestOperations _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient; + private readonly NewRelicMonitoredSubscriptionData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "NewRelic.Observability/monitors/monitoredSubscriptions"; - /// Initializes a new instance of the class for mocking. - protected MonitoredSubscriptionPropertyResource() + /// Initializes a new instance of the class for mocking. + protected NewRelicMonitoredSubscriptionResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal MonitoredSubscriptionPropertyResource(ArmClient client, MonitoredSubscriptionPropertyData data) : this(client, data.Id) + internal NewRelicMonitoredSubscriptionResource(ArmClient client, NewRelicMonitoredSubscriptionData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal MonitoredSubscriptionPropertyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NewRelicMonitoredSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); - _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, monitoredSubscriptionPropertyMonitoredSubscriptionsApiVersion); + _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NewRelicObservability", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string newRelicMonitoredSubscriptionMonitoredSubscriptionsApiVersion); + _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient = new MonitoredSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, newRelicMonitoredSubscriptionMonitoredSubscriptionsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal MonitoredSubscriptionPropertyResource(ArmClient client, ResourceIdentif /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual MonitoredSubscriptionPropertyData Data + public virtual NewRelicMonitoredSubscriptionData Data { get { @@ -106,21 +106,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Get"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionResource.Get"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.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 MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NewRelicMonitoredSubscriptionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -146,21 +146,21 @@ public virtual async Task> GetAs /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Get"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionResource.Get"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MonitoredSubscriptionPropertyResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new NewRelicMonitoredSubscriptionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -186,7 +186,7 @@ public virtual Response Get(CancellationT /// /// /// Resource - /// + /// /// /// /// @@ -194,12 +194,12 @@ public virtual Response Get(CancellationT /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Delete"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionResource.Delete"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NewRelicObservabilityArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(_newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -236,12 +236,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Delete"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionResource.Delete"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new NewRelicObservabilityArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new NewRelicObservabilityArmOperation(_newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -270,24 +270,24 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. + /// The to use. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Update"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionResource.Update"); scope.Start(); try { - var response = await _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitoredSubscriptionOperationSource(Client), _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -316,24 +316,24 @@ public virtual async Task> U /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. + /// The to use. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics.CreateScope("MonitoredSubscriptionPropertyResource.Update"); + using var scope = _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics.CreateScope("NewRelicMonitoredSubscriptionResource.Update"); scope.Start(); try { - var response = _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new NewRelicObservabilityArmOperation(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NewRelicObservabilityArmOperation(new NewRelicMonitoredSubscriptionOperationSource(Client), _newRelicMonitoredSubscriptionMonitoredSubscriptionsClientDiagnostics, Pipeline, _newRelicMonitoredSubscriptionMonitoredSubscriptionsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.Serialization.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.Serialization.cs index bfd470e86e9f0..5ec472840ea0d 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.Serialization.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -195,6 +196,122 @@ internal static NewRelicObservabilityTagRuleData DeserializeNewRelicObservabilit serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LogRules)) + { + builder.Append(" logRules: "); + BicepSerializationHelpers.AppendChildObject(builder, LogRules, options, 4, false, " logRules: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MetricRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metricRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MetricRules)) + { + builder.Append(" metricRules: "); + BicepSerializationHelpers.AppendChildObject(builder, MetricRules, options, 4, false, " metricRules: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -203,6 +320,8 @@ BinaryData IPersistableModel.Write(ModelReader { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NewRelicObservabilityTagRuleData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.cs index 3f8ad4ce05eaa..bfbd1f2966375 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicObservabilityTagRuleData.cs @@ -74,10 +74,13 @@ internal NewRelicObservabilityTagRuleData(ResourceIdentifier id, string name, Re } /// Provisioning State of the resource. + [WirePath("properties.provisioningState")] public NewRelicProvisioningState? ProvisioningState { get; } /// Set of rules for sending logs for the Monitor resource. + [WirePath("properties.logRules")] public NewRelicObservabilityLogRules LogRules { get; set; } /// Set of rules for sending metrics for the Monitor resource. + [WirePath("properties.metricRules")] public NewRelicObservabilityMetricRules MetricRules { get; set; } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs index b631683b3cb0c..636c65ad9dbff 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/BillingInfoRestOperations.cs @@ -79,7 +79,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// 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 monitorName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -91,9 +91,9 @@ public async Task> GetAsync(string subscriptionId, s { case 200: { - BillingInfoResult value = default; + NewRelicBillingInfoResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BillingInfoResult.DeserializeBillingInfoResult(document.RootElement); + value = NewRelicBillingInfoResult.DeserializeNewRelicBillingInfoResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -108,7 +108,7 @@ public async Task> GetAsync(string subscriptionId, s /// 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 monitorName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -120,9 +120,9 @@ public Response Get(string subscriptionId, string resourceGro { case 200: { - BillingInfoResult value = default; + NewRelicBillingInfoResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BillingInfoResult.DeserializeBillingInfoResult(document.RootElement); + value = NewRelicBillingInfoResult.DeserializeNewRelicBillingInfoResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs index fef287e713673..8404346585180 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs @@ -130,7 +130,7 @@ public Response List(string subscriptionId, } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,7 +146,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -176,7 +176,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -188,13 +188,13 @@ public async Task> GetAsync(string s { case 200: { - MonitoredSubscriptionPropertyData value = default; + NewRelicMonitoredSubscriptionData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + value = NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + return Response.FromValue((NewRelicMonitoredSubscriptionData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -208,7 +208,7 @@ public async Task> GetAsync(string s /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,19 +220,19 @@ public Response Get(string subscriptionId, st { case 200: { - MonitoredSubscriptionPropertyData value = default; + NewRelicMonitoredSubscriptionData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + value = NewRelicMonitoredSubscriptionData.DeserializeNewRelicMonitoredSubscriptionData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + return Response.FromValue((NewRelicMonitoredSubscriptionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -248,7 +248,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -279,11 +279,11 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The name of the resource group. The name is case insensitive. /// Name of the Monitors resource. /// The configuration name. Only 'default' value is supported. - /// The to use. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -307,11 +307,11 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The name of the resource group. The name is case insensitive. /// Name of the Monitors resource. /// The configuration name. Only 'default' value is supported. - /// The to use. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -330,7 +330,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -346,7 +346,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -377,11 +377,11 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The name of the resource group. The name is case insensitive. /// Name of the Monitors resource. /// The configuration name. Only 'default' value is supported. - /// The to use. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -405,11 +405,11 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The name of the resource group. The name is case insensitive. /// Name of the Monitors resource. /// The configuration name. Only 'default' value is supported. - /// The to use. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, NewRelicMonitoredSubscriptionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -428,7 +428,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string m } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -444,7 +444,7 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -474,7 +474,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -500,7 +500,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// 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 monitorName, ConfigurationName configurationName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string monitorName, MonitoredSubscriptionConfigurationName configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs index afc9f47db0e3c..9aa3fc5038365 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/RestOperations/MonitorsRestOperations.cs @@ -1131,7 +1131,7 @@ internal HttpMessage CreateListMonitoredResourcesRequest(string subscriptionId, /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListMonitoredResourcesAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task> ListMonitoredResourcesAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -1143,9 +1143,9 @@ public async Task> Li { case 200: { - NewRelicObservabilityMonitoredResourceListResult value = default; + NewRelicMonitoredResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NewRelicObservabilityMonitoredResourceListResult.DeserializeNewRelicObservabilityMonitoredResourceListResult(document.RootElement); + value = NewRelicMonitoredResourceListResult.DeserializeNewRelicMonitoredResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1160,7 +1160,7 @@ public async Task> Li /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListMonitoredResources(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response ListMonitoredResources(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -1172,9 +1172,9 @@ public Response ListMonitoredR { case 200: { - NewRelicObservabilityMonitoredResourceListResult value = default; + NewRelicMonitoredResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NewRelicObservabilityMonitoredResourceListResult.DeserializeNewRelicObservabilityMonitoredResourceListResult(document.RootElement); + value = NewRelicMonitoredResourceListResult.DeserializeNewRelicMonitoredResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1732,7 +1732,7 @@ internal HttpMessage CreateListMonitoredResourcesNextPageRequest(string nextLink /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListMonitoredResourcesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task> ListMonitoredResourcesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -1745,9 +1745,9 @@ public async Task> Li { case 200: { - NewRelicObservabilityMonitoredResourceListResult value = default; + NewRelicMonitoredResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NewRelicObservabilityMonitoredResourceListResult.DeserializeNewRelicObservabilityMonitoredResourceListResult(document.RootElement); + value = NewRelicMonitoredResourceListResult.DeserializeNewRelicMonitoredResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1763,7 +1763,7 @@ public async Task> Li /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListMonitoredResourcesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response ListMonitoredResourcesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -1776,9 +1776,9 @@ public Response ListMonitoredR { case 200: { - NewRelicObservabilityMonitoredResourceListResult value = default; + NewRelicMonitoredResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NewRelicObservabilityMonitoredResourceListResult.DeserializeNewRelicObservabilityMonitoredResourceListResult(document.RootElement); + value = NewRelicMonitoredResourceListResult.DeserializeNewRelicMonitoredResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md index 8aaf43233b1f8..bc370ae4c384b 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/autorest.md @@ -8,6 +8,7 @@ csharp: true library-name: Newrelic namespace: Azure.ResourceManager.NewRelicObservability require: https://github.com/Azure/azure-rest-api-specs/blob/07d286359f828bbc7901e86288a5d62b48ae2052/specification/newrelic/resource-manager/readme.md +#tag: package-2024-03-01 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -17,9 +18,10 @@ skip-csproj: true modelerfour: flatten-payloads: false use-model-reader-writer: true +enable-bicep-serialization: true -# mgmt-debug: -# show-serialized-names: true +#mgmt-debug: +# show-serialized-names: true format-by-name-rules: 'tenantId': 'uuid' @@ -100,7 +102,7 @@ rename-mapping: AppServicesGetRequest.azureResourceIds: -|arm-id AppServiceInfo.azureResourceId: -|arm-id AppServicesListResponse: NewRelicAppServicesListResult - BillingInfoResponse: BillingInfoResult + BillingInfoResponse: NewRelicBillingInfoResult AzureStorageBlobContainerEndpointProperties: StorageBlobContainerEndpointProperties AzureStorageBlobContainerNewrelicEndpointProperties.StorageAccountResourceId: -|arm-id HostsGetRequest: NewRelicHostsGetContent @@ -119,7 +121,7 @@ rename-mapping: MetricsStatusResponse: NewRelicMetricsStatusResult MonitoredResource: NewRelicResourceMonitorResult MonitoredResource.id: -|arm-id - MonitoredResourceListResponse: NewRelicObservabilityMonitoredResourceListResult + MonitoredResourceListResponse: NewRelicMonitoredResourceListResult MonitoringStatus.Disabled: IsDisabled MonitoringStatus.Enabled: IsEnabled NewrelicAgentData.LocalIPAddress: -|ip-address @@ -128,6 +130,7 @@ rename-mapping: Project: NewRelicProject PlanDataListResponse: NewRelicPlanDataListResult PlanData: NewRelicPlanDetails + PlanData.billingCycle: NewRelicPlanBillingCycle PlanDataResource: NewRelicPlanData OrganizationResource: NewRelicOrganizationResourceData SendAadLogsStatus.Disabled: IsDisabled @@ -145,6 +148,15 @@ rename-mapping: SwitchBillingRequest: NewRelicSwitchBillingContent SwitchBillingRequest.azureResourceId: -|arm-id VMInfo.vmId: -|arm-id + MonitoredSubscriptionProperties: NewRelicMonitoredSubscription + ConfigurationName: MonitoredSubscriptionConfigurationName + ConnectedPartnerResourceProperties: NewRelicConnectedPartnerResourceProperties + ConnectedPartnerResourcesListFormat: NewRelicConnectedPartnerResourceInfo + PatchOperation: MonitoredSubscriptionPatchOperation + Status: NewRelicMonitoringStatus + SubscriptionList: NewRelicMonitoredSubscriptionProperties + MonitoredSubscription: NewRelicMonitoredSubscriptionInfo + MonitoringTagRulesProperties: NewRelicMonitoringTagRules override-operation-name: Accounts_List: GetNewRelicAccounts From 953860bd74942d05ada3cecd2efab79ced30ff02 Mon Sep 17 00:00:00 2001 From: VIPRAY JAIN Date: Tue, 9 Jul 2024 09:42:21 +0530 Subject: [PATCH 6/7] resolving comments --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8f2d107887417..2c27dbd1541bb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -938,10 +938,10 @@ # ServiceLabel: %Astronomer %Mgmt # ServiceOwners: @banggaurav -# PRLabel: %NewRelicObservability -/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ @dipeshbhakat-microsoft @vipray-ms +# PRLabel: %New Relic +/sdk/newrelicobservability/Azure.ResourceManager.*/ @dipeshbhakat-microsoft @vipray-ms -# ServiceLabel: %NewRelicObservability %Mgmt +# ServiceLabel: %New Relic %Mgmt # ServiceOwners: @dipeshbhakat-microsoft @vipray-ms From a5f9a71b2ba75f414fab195e6633267fa46d7405 Mon Sep 17 00:00:00 2001 From: VIPRAY JAIN Date: Wed, 10 Jul 2024 09:12:44 +0530 Subject: [PATCH 7/7] Resolving Comments --- .github/CODEOWNERS | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2c27dbd1541bb..b42ecadd6ec0c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -938,13 +938,6 @@ # ServiceLabel: %Astronomer %Mgmt # ServiceOwners: @banggaurav -# PRLabel: %New Relic -/sdk/newrelicobservability/Azure.ResourceManager.*/ @dipeshbhakat-microsoft @vipray-ms - -# ServiceLabel: %New Relic %Mgmt -# ServiceOwners: @dipeshbhakat-microsoft @vipray-ms - - # PRLabel: %Communication - Resource Manager /sdk/communication/Azure.ResourceManager.Communication/ @archerzz @ArcturusZhang @ArthurMa1978 @@ -978,6 +971,12 @@ # ServiceLabel: %Network - Front Door %Mgmt # ServiceOwners: @ptnan7 +# PRLabel: %New Relic +/sdk/newrelicobservability/Azure.ResourceManager.*/ @dipeshbhakat-microsoft @vipray-ms + +# ServiceLabel: %New Relic %Mgmt +# ServiceOwners: @dipeshbhakat-microsoft @vipray-ms + # PRLabel: %Nginx /sdk/nginx/Azure.ResourceManager.*/ @jamesfan1 @bangbingsyb @spencerofwiti