From 9332be12692295e53d3df164a160b68f4aba2869 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 9 May 2025 09:37:07 +0000 Subject: [PATCH] CodeGen from PR 34281 in Azure/azure-rest-api-specs Merge 2a21db906ee60d3dfef4e1b833c0c555b28af8c3 into 761d8b58e465b26eddb8ad70dda3cde7b4228bdf --- .../Azure.ResourceManager.Datadog.net8.0.cs | 338 ++++++- ....ResourceManager.Datadog.netstandard2.0.cs | 338 ++++++- .../Samples/Sample_DatadogMonitorResource.cs | 95 +- ...Sample_DatadogMonitorResourceCollection.cs | 49 +- .../Sample_DatadogSingleSignOnResource.cs | 18 +- ...e_DatadogSingleSignOnResourceCollection.cs | 30 +- ...MonitoredSubscriptionPropertyCollection.cs | 249 +++++ ...e_MonitoredSubscriptionPropertyResource.cs | 167 ++++ .../Sample_MonitoringTagRuleCollection.cs | 47 +- .../Sample_MonitoringTagRuleResource.cs | 35 +- .../Sample_SubscriptionResourceExtensions.cs | 162 +++ .../Sample_TenantResourceExtensions.cs | 43 + .../src/Generated/ArmDatadogModelFactory.cs | 250 +++-- .../src/Generated/DatadogMonitorResource.cs | 441 ++++++--- .../DatadogMonitorResourceCollection.cs | 98 +- .../Generated/DatadogMonitorResourceData.cs | 2 +- .../Generated/DatadogSingleSignOnResource.cs | 46 +- .../DatadogSingleSignOnResourceCollection.cs | 98 +- .../DatadogSingleSignOnResourceData.cs | 5 +- .../Generated/Extensions/DatadogExtensions.cs | 322 +++++- .../Extensions/MockableDatadogArmClient.cs | 12 + .../MockableDatadogResourceGroupResource.cs | 8 +- .../MockableDatadogSubscriptionResource.cs | 258 +++-- .../MockableDatadogTenantResource.cs | 95 ++ ...oredSubscriptionPropertyOperationSource.cs | 36 + .../Models/BillingInfoResult.Serialization.cs | 148 +++ .../src/Generated/Models/BillingInfoResult.cs | 69 ++ ...sourceSupportedProperties.Serialization.cs | 144 +++ .../CreateResourceSupportedProperties.cs | 69 ++ ...urceSupportedResponseList.Serialization.cs | 151 +++ .../CreateResourceSupportedResponseList.cs | 80 ++ ...teResourceSupportedResult.Serialization.cs | 133 +++ .../Models/CreateResourceSupportedResult.cs | 65 ++ ...DatadogAgreementResource.Serialization.cs} | 38 +- ...perties.cs => DatadogAgreementResource.cs} | 12 +- ...ementResourceListResponse.Serialization.cs | 35 +- .../DatadogAgreementResourceListResponse.cs | 28 +- ...DatadogApiKeyListResponse.Serialization.cs | 29 +- .../Models/DatadogApiKeyListResponse.cs | 26 +- .../src/Generated/Models/DatadogHost.cs | 4 +- .../DatadogHostListResponse.Serialization.cs | 29 +- .../Models/DatadogHostListResponse.cs | 26 +- ...nitorResourceListResponse.Serialization.cs | 29 +- .../DatadogMonitorResourceListResponse.cs | 26 +- .../Models/DatadogMonitorResourcePatch.cs | 16 +- ...dogOrganizationProperties.Serialization.cs | 30 +- .../Models/DatadogOrganizationProperties.cs | 22 +- ...dogSingleSignOnProperties.Serialization.cs | 10 +- .../Models/DatadogSingleSignOnProperties.cs | 4 +- ...ignOnResourceListResponse.Serialization.cs | 29 +- ...DatadogSingleSignOnResourceListResponse.cs | 26 +- .../Generated/Models/LiftrResourceCategory.cs | 2 +- .../Models/LinkedResource.Serialization.cs | 140 +++ .../src/Generated/Models/LinkedResource.cs | 69 ++ ...inkedResourceListResponse.Serialization.cs | 36 +- .../Models/LinkedResourceListResponse.cs | 29 +- .../MarketplaceSaaSInfo.Serialization.cs | 183 ++++ .../Generated/Models/MarketplaceSaaSInfo.cs | 81 ++ .../src/Generated/Models/MonitorProperties.cs | 8 +- .../MonitorUpdateProperties.Serialization.cs | 19 +- .../Models/MonitorUpdateProperties.cs | 8 +- ....cs => MonitoredResource.Serialization.cs} | 38 +- ...esourceContent.cs => MonitoredResource.cs} | 10 +- ...toredResourceListResponse.Serialization.cs | 35 +- .../Models/MonitoredResourceListResponse.cs | 28 +- .../MonitoredSubscription.Serialization.cs | 167 ++++ .../Generated/Models/MonitoredSubscription.cs | 87 ++ ...ubscriptionPropertiesList.Serialization.cs | 151 +++ .../MonitoredSubscriptionPropertiesList.cs | 80 ++ ...oringTagRulesListResponse.Serialization.cs | 29 +- .../Models/MonitoringTagRulesListResponse.cs | 26 +- ...itoringTagRulesProperties.Serialization.cs | 38 +- .../Models/MonitoringTagRulesProperties.cs | 11 +- .../src/Generated/Models/Operation.cs | 60 ++ .../Models/OperationDisplay.Serialization.cs | 162 +++ .../src/Generated/Models/OperationDisplay.cs | 77 ++ .../OperationListResult.Serialization.cs | 147 +++ .../Generated/Models/OperationListResult.cs | 80 ++ .../Models/OperationResult.Serialization.cs | 159 +++ .../src/Generated/Models/OperationResult.cs | 73 ++ .../PartnerBillingEntity.Serialization.cs | 151 +++ .../Generated/Models/PartnerBillingEntity.cs | 73 ++ .../src/Generated/Models/ResourceSku.cs | 8 +- .../src/Generated/Models/Status.cs | 57 ++ .../Models/SubscriptionList.Serialization.cs | 158 +++ .../src/Generated/Models/SubscriptionList.cs | 70 ++ .../src/Generated/Models/UserInfo.cs | 2 +- ...MonitoredSubscriptionPropertyCollection.cs | 493 +++++++++ ...dSubscriptionPropertyData.Serialization.cs | 155 +++ .../MonitoredSubscriptionPropertyData.cs | 75 ++ ...scriptionPropertyResource.Serialization.cs | 26 + .../MonitoredSubscriptionPropertyResource.cs | 347 +++++++ .../Generated/MonitoringTagRuleCollection.cs | 40 +- .../Generated/MonitoringTagRuleResource.cs | 16 +- ...onSupportedOperationGroupRestOperations.cs | 287 ++++++ ... DatadogMonitorResourcesRestOperations.cs} | 936 ++++++++++-------- ...dogSingleSignOnResourcesRestOperations.cs} | 120 +-- ...AgreementsOperationGroupRestOperations.cs} | 61 +- .../MonitoredSubscriptionsRestOperations.cs | 617 ++++++++++++ .../OperationsRestOperations.cs | 173 ++++ .../RestOperations/TagRulesRestOperations.cs | 114 +-- .../src/autorest.md | 56 -- .../Sample_SubscriptionResourceExtensions.cs | 102 -- .../tsp-location.yaml | 4 + sdk/storage/ci.yml | 2 + 105 files changed, 9010 insertions(+), 1686 deletions(-) rename sdk/datadog/Azure.ResourceManager.Datadog/{tests => samples}/Generated/Samples/Sample_DatadogMonitorResource.cs (74%) rename sdk/datadog/Azure.ResourceManager.Datadog/{tests => samples}/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs (80%) rename sdk/datadog/Azure.ResourceManager.Datadog/{tests => samples}/Generated/Samples/Sample_DatadogSingleSignOnResource.cs (82%) rename sdk/datadog/Azure.ResourceManager.Datadog/{tests => samples}/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs (85%) create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs rename sdk/datadog/Azure.ResourceManager.Datadog/{tests => samples}/Generated/Samples/Sample_MonitoringTagRuleCollection.cs (84%) rename sdk/datadog/Azure.ResourceManager.Datadog/{tests => samples}/Generated/Samples/Sample_MonitoringTagRuleResource.cs (76%) create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_TenantResourceExtensions.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogTenantResource.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.cs rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/{DatadogAgreementResourceProperties.Serialization.cs => DatadogAgreementResource.Serialization.cs} (70%) rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/{DatadogAgreementResourceProperties.cs => DatadogAgreementResource.cs} (81%) create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.cs rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/{MonitoredResourceContent.Serialization.cs => MonitoredResource.Serialization.cs} (76%) rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/{MonitoredResourceContent.cs => MonitoredResource.cs} (90%) create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Operation.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Status.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyCollection.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedOperationGroupRestOperations.cs rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/{MonitorsRestOperations.cs => DatadogMonitorResourcesRestOperations.cs} (92%) rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/{SingleSignOnConfigurationsRestOperations.cs => DatadogSingleSignOnResourcesRestOperations.cs} (96%) rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/{MarketplaceAgreementsRestOperations.cs => MarketplaceAgreementsOperationGroupRestOperations.cs} (85%) create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/OperationsRestOperations.cs delete mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md delete mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/tsp-location.yaml diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.net8.0.cs b/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.net8.0.cs index e99d54eb3c19..072895933e5b 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.net8.0.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.net8.0.cs @@ -8,8 +8,12 @@ internal AzureResourceManagerDatadogContext() { } } public static partial class DatadogExtensions { - public static Azure.Response CreateOrUpdateMarketplaceAgreement(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CreateOrUpdateMarketplaceAgreementsOperationGroup(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetCreationSupportedOperationGroup(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCreationSupportedOperationGroupAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetCreationSupportedOperationGroups(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetCreationSupportedOperationGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Datadog.DatadogMonitorResource GetDatadogMonitorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetDatadogMonitorResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string monitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetDatadogMonitorResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string monitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -17,9 +21,12 @@ public static partial class DatadogExtensions public static Azure.Pageable GetDatadogMonitorResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetDatadogMonitorResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Datadog.DatadogSingleSignOnResource GetDatadogSingleSignOnResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Pageable GetMarketplaceAgreements(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetMarketplaceAgreementsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetMarketplaceAgreementsOperationGroups(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMarketplaceAgreementsOperationGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Datadog.MonitoringTagRuleResource GetMonitoringTagRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Pageable GetOperations(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOperationsAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DatadogMonitorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -29,6 +36,8 @@ protected DatadogMonitorResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response BillingInfoGet(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BillingInfoGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName) { 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; } @@ -43,10 +52,13 @@ protected DatadogMonitorResource() { } public virtual System.Threading.Tasks.Task> GetDefaultKeyAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHosts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHostsAsync(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.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.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.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.Datadog.MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionProperties() { throw null; } + public virtual Azure.Response GetMonitoredSubscriptionProperty(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMonitoredSubscriptionPropertyAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMonitoringTagRule(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMonitoringTagRuleAsync(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Datadog.MonitoringTagRuleCollection GetMonitoringTagRules() { throw null; } @@ -63,8 +75,8 @@ protected DatadogMonitorResource() { } Azure.ResourceManager.Datadog.DatadogMonitorResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.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.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DatadogMonitorResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -141,6 +153,53 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class 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, string configurationName, Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string 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(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string 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.Datadog.Models.SubscriptionList Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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.Datadog.MonitoredSubscriptionPropertyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, string 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.Datadog.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.Datadog.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.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class MonitoringTagRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MonitoringTagRuleCollection() { } @@ -194,6 +253,7 @@ public partial class MockableDatadogArmClient : Azure.ResourceManager.ArmResourc protected MockableDatadogArmClient() { } public virtual Azure.ResourceManager.Datadog.DatadogMonitorResource GetDatadogMonitorResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Datadog.DatadogSingleSignOnResource GetDatadogSingleSignOnResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Datadog.MonitoringTagRuleResource GetMonitoringTagRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDatadogResourceGroupResource : Azure.ResourceManager.ArmResource @@ -206,31 +266,84 @@ protected MockableDatadogResourceGroupResource() { } public partial class MockableDatadogSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableDatadogSubscriptionResource() { } - public virtual Azure.Response CreateOrUpdateMarketplaceAgreement(Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementAsync(Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdateMarketplaceAgreementsOperationGroup(Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCreationSupportedOperationGroup(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCreationSupportedOperationGroupAsync(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetCreationSupportedOperationGroups(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetCreationSupportedOperationGroupsAsync(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDatadogMonitorResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDatadogMonitorResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetMarketplaceAgreements(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMarketplaceAgreementsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMarketplaceAgreementsOperationGroups(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMarketplaceAgreementsOperationGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableDatadogTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableDatadogTenantResource() { } + public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Datadog.Models { public static partial class ArmDatadogModelFactory { - public static Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties DatadogAgreementResourceProperties(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.DatadogAgreementProperties properties = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.BillingInfoResult BillingInfoResult(Azure.ResourceManager.Datadog.Models.MarketplaceSaaSInfo marketplaceSaasInfo = null, Azure.ResourceManager.Datadog.Models.PartnerBillingEntity partnerBillingEntity = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties CreateResourceSupportedProperties(string name = null, bool? creationSupported = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResult CreateResourceSupportedResult(Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties properties = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.DatadogAgreementResource DatadogAgreementResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.DatadogAgreementProperties properties = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogHost DatadogHost(string name = null, System.Collections.Generic.IEnumerable aliases = null, System.Collections.Generic.IEnumerable apps = null, Azure.ResourceManager.Datadog.Models.DatadogHostMetadata meta = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogHostMetadata DatadogHostMetadata(string agentVersion = null, Azure.ResourceManager.Datadog.Models.DatadogInstallMethod installMethod = null, string logsAgentTransport = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogInstallMethod DatadogInstallMethod(string tool = null, string toolVersion = null, string installerVersion = null) { throw null; } public static Azure.ResourceManager.Datadog.DatadogMonitorResourceData DatadogMonitorResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string skuName = null, Azure.ResourceManager.Datadog.Models.MonitorProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.DatadogOrganizationProperties DatadogOrganizationProperties(string name = null, string id = null, string linkingAuthCode = null, string linkingClientId = null, System.Uri redirectUri = null, string apiKey = null, string applicationKey = null, string enterpriseAppId = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogSetPasswordLink DatadogSetPasswordLink(string setPasswordLink = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties DatadogSingleSignOnProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.SingleSignOnState? singleSignOnState = default(Azure.ResourceManager.Datadog.Models.SingleSignOnState?), string enterpriseAppId = null, System.Uri singleSignOnUri = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties DatadogSingleSignOnProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.SingleSignOnState? singleSignOnState = default(Azure.ResourceManager.Datadog.Models.SingleSignOnState?), string enterpriseAppId = null, string singleSignOnUri = null) { throw null; } public static Azure.ResourceManager.Datadog.DatadogSingleSignOnResourceData DatadogSingleSignOnResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties properties = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.MonitoredResourceContent MonitoredResourceContent(string id = null, bool? sendingMetrics = default(bool?), string reasonForMetricsStatus = null, bool? sendingLogs = default(bool?), string reasonForLogsStatus = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.LinkedResource LinkedResource(string id = null, string location = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.MarketplaceSaaSInfo MarketplaceSaaSInfo(string marketplaceSubscriptionId = null, string marketplaceName = null, string marketplaceStatus = null, string billedAzureSubscriptionId = null, bool? subscribed = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.MonitoredResource MonitoredResource(string id = null, bool? sendingMetrics = default(bool?), string reasonForMetricsStatus = null, bool? sendingLogs = default(bool?), string reasonForLogsStatus = null) { throw null; } + public static Azure.ResourceManager.Datadog.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.Datadog.Models.SubscriptionList properties = null) { throw null; } public static Azure.ResourceManager.Datadog.MonitoringTagRuleData MonitoringTagRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties properties = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties MonitoringTagRulesProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.LogRules logRules = null, System.Collections.Generic.IEnumerable metricRulesFilteringTags = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties MonitoringTagRulesProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.LogRules logRules = null, System.Collections.Generic.IEnumerable metricRulesFilteringTags = null, bool? automuting = default(bool?), bool? customMetrics = default(bool?)) { throw null; } public static Azure.ResourceManager.Datadog.Models.MonitorProperties MonitorProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.MonitoringStatus? monitoringStatus = default(Azure.ResourceManager.Datadog.Models.MonitoringStatus?), Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus?), Azure.ResourceManager.Datadog.Models.DatadogOrganizationProperties datadogOrganizationProperties = null, Azure.ResourceManager.Datadog.Models.UserInfo userInfo = null, Azure.ResourceManager.Datadog.Models.LiftrResourceCategory? liftrResourceCategory = default(Azure.ResourceManager.Datadog.Models.LiftrResourceCategory?), int? liftrResourcePreference = default(int?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.OperationResult OperationResult(string name = null, Azure.ResourceManager.Datadog.Models.OperationDisplay display = null, bool? isDataAction = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.PartnerBillingEntity PartnerBillingEntity(string id = null, string name = null, string partnerEntityUri = null) { throw null; } + } + public partial class BillingInfoResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BillingInfoResult() { } + public Azure.ResourceManager.Datadog.Models.MarketplaceSaaSInfo MarketplaceSaasInfo { get { throw null; } } + public Azure.ResourceManager.Datadog.Models.PartnerBillingEntity PartnerBillingEntity { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } + } + public partial class CreateResourceSupportedProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CreateResourceSupportedProperties() { } + public bool? CreationSupported { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateResourceSupportedResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CreateResourceSupportedResult() { } + public Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties Properties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DatadogAgreementProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -250,16 +363,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DatadogAgreementResourceProperties : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DatadogAgreementResource : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DatadogAgreementResourceProperties() { } + public DatadogAgreementResource() { } public Azure.ResourceManager.Datadog.Models.DatadogAgreementProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Datadog.Models.DatadogAgreementResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.DatadogAgreementResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DatadogApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -318,7 +431,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class DatadogMonitorResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DatadogMonitorResourcePatch() { } - public Azure.ResourceManager.Datadog.Models.MonitoringStatus? MonitorUpdateMonitoringStatus { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitorUpdateProperties Properties { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -333,12 +446,13 @@ public partial class DatadogOrganizationProperties : System.ClientModel.Primitiv public DatadogOrganizationProperties() { } public string ApiKey { get { throw null; } set { } } public string ApplicationKey { get { throw null; } set { } } + public bool? Cspm { get { throw null; } set { } } public string EnterpriseAppId { get { throw null; } set { } } - public string Id { get { throw null; } } + public string Id { get { throw null; } set { } } public string LinkingAuthCode { get { throw null; } set { } } public string LinkingClientId { get { throw null; } set { } } - public string Name { get { throw null; } } - public System.Uri RedirectUri { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string RedirectUri { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Datadog.Models.DatadogOrganizationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -363,7 +477,7 @@ public DatadogSingleSignOnProperties() { } public string EnterpriseAppId { get { throw null; } set { } } public Azure.ResourceManager.Datadog.Models.ProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Datadog.Models.SingleSignOnState? SingleSignOnState { get { throw null; } set { } } - public System.Uri SingleSignOnUri { get { throw null; } } + public string SingleSignOnUri { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -402,6 +516,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Datadog.Models.LiftrResourceCategory left, Azure.ResourceManager.Datadog.Models.LiftrResourceCategory right) { throw null; } public override string ToString() { throw null; } } + public partial class LinkedResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LinkedResource() { } + public string Id { get { throw null; } } + public string Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.LinkedResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.LinkedResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LogRules : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LogRules() { } @@ -416,6 +542,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MarketplaceSaaSInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketplaceSaaSInfo() { } + public string BilledAzureSubscriptionId { get { throw null; } } + public string MarketplaceName { get { throw null; } } + public string MarketplaceStatus { get { throw null; } } + public string MarketplaceSubscriptionId { get { throw null; } } + public bool? Subscribed { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable { @@ -436,20 +577,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class MonitoredResourceContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class MonitoredResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitoredResourceContent() { } + internal MonitoredResource() { } public string Id { get { throw null; } } public string ReasonForLogsStatus { get { throw null; } } public string ReasonForMetricsStatus { get { throw null; } } public bool? SendingLogs { get { throw null; } } public bool? SendingMetrics { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.MonitoredResourceContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.MonitoredResourceContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Datadog.Models.MonitoredResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.MonitoredResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(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(string subscriptionId) { } + public string Error { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.Status? Status { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties TagRules { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MonitoringStatus : System.IEquatable @@ -472,6 +627,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MonitoringTagRulesProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MonitoringTagRulesProperties() { } + public bool? Automuting { get { throw null; } set { } } + public bool? CustomMetrics { get { throw null; } set { } } public Azure.ResourceManager.Datadog.Models.LogRules LogRules { get { throw null; } set { } } public System.Collections.Generic.IList MetricRulesFilteringTags { get { throw null; } } public Azure.ResourceManager.Datadog.Models.ProvisioningState? ProvisioningState { get { throw null; } } @@ -499,6 +656,79 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MonitorUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorUpdateProperties() { } + public bool? Cspm { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitoringStatus? MonitoringStatus { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.MonitorUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.MonitorUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 Operation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Operation(string value) { throw null; } + public static Azure.ResourceManager.Datadog.Models.Operation Active { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation AddBegin { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation AddComplete { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation DeleteBegin { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation DeleteComplete { get { throw null; } } + public bool Equals(Azure.ResourceManager.Datadog.Models.Operation 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.Datadog.Models.Operation left, Azure.ResourceManager.Datadog.Models.Operation right) { throw null; } + public static implicit operator Azure.ResourceManager.Datadog.Models.Operation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Datadog.Models.Operation left, Azure.ResourceManager.Datadog.Models.Operation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OperationDisplay : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDisplay() { } + public string Description { get { throw null; } } + public string Operation { get { throw null; } } + public string Provider { get { throw null; } } + public string Resource { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationDisplay System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationDisplay System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationResult() { } + public Azure.ResourceManager.Datadog.Models.OperationDisplay Display { get { throw null; } } + public bool? IsDataAction { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(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 Id { get { throw null; } } + public string Name { get { throw null; } } + public string PartnerEntityUri { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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 ProvisioningState : System.IEquatable { @@ -545,6 +775,38 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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.Datadog.Models.Status Active { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Status Deleting { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Status Failed { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Status InProgress { get { throw null; } } + public bool Equals(Azure.ResourceManager.Datadog.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.Datadog.Models.Status left, Azure.ResourceManager.Datadog.Models.Status right) { throw null; } + public static implicit operator Azure.ResourceManager.Datadog.Models.Status (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Datadog.Models.Status left, Azure.ResourceManager.Datadog.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.Datadog.Models.Operation? Operation { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct TagAction : System.IEquatable { private readonly object _dummy; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.netstandard2.0.cs b/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.netstandard2.0.cs index e99d54eb3c19..072895933e5b 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.netstandard2.0.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/api/Azure.ResourceManager.Datadog.netstandard2.0.cs @@ -8,8 +8,12 @@ internal AzureResourceManagerDatadogContext() { } } public static partial class DatadogExtensions { - public static Azure.Response CreateOrUpdateMarketplaceAgreement(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CreateOrUpdateMarketplaceAgreementsOperationGroup(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetCreationSupportedOperationGroup(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCreationSupportedOperationGroupAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetCreationSupportedOperationGroups(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetCreationSupportedOperationGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Datadog.DatadogMonitorResource GetDatadogMonitorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetDatadogMonitorResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string monitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetDatadogMonitorResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string monitorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -17,9 +21,12 @@ public static partial class DatadogExtensions public static Azure.Pageable GetDatadogMonitorResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetDatadogMonitorResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Datadog.DatadogSingleSignOnResource GetDatadogSingleSignOnResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Pageable GetMarketplaceAgreements(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetMarketplaceAgreementsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetMarketplaceAgreementsOperationGroups(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMarketplaceAgreementsOperationGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Datadog.MonitoringTagRuleResource GetMonitoringTagRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Pageable GetOperations(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOperationsAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DatadogMonitorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -29,6 +36,8 @@ protected DatadogMonitorResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response BillingInfoGet(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BillingInfoGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName) { 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; } @@ -43,10 +52,13 @@ protected DatadogMonitorResource() { } public virtual System.Threading.Tasks.Task> GetDefaultKeyAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHosts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHostsAsync(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.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.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.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.Datadog.MonitoredSubscriptionPropertyCollection GetMonitoredSubscriptionProperties() { throw null; } + public virtual Azure.Response GetMonitoredSubscriptionProperty(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMonitoredSubscriptionPropertyAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMonitoringTagRule(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMonitoringTagRuleAsync(string ruleSetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Datadog.MonitoringTagRuleCollection GetMonitoringTagRules() { throw null; } @@ -63,8 +75,8 @@ protected DatadogMonitorResource() { } Azure.ResourceManager.Datadog.DatadogMonitorResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.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.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.Models.DatadogMonitorResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DatadogMonitorResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -141,6 +153,53 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class 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, string configurationName, Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string 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(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string 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.Datadog.Models.SubscriptionList Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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.Datadog.MonitoredSubscriptionPropertyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string monitorName, string 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.Datadog.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.Datadog.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.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class MonitoringTagRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MonitoringTagRuleCollection() { } @@ -194,6 +253,7 @@ public partial class MockableDatadogArmClient : Azure.ResourceManager.ArmResourc protected MockableDatadogArmClient() { } public virtual Azure.ResourceManager.Datadog.DatadogMonitorResource GetDatadogMonitorResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Datadog.DatadogSingleSignOnResource GetDatadogSingleSignOnResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Datadog.MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Datadog.MonitoringTagRuleResource GetMonitoringTagRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDatadogResourceGroupResource : Azure.ResourceManager.ArmResource @@ -206,31 +266,84 @@ protected MockableDatadogResourceGroupResource() { } public partial class MockableDatadogSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableDatadogSubscriptionResource() { } - public virtual Azure.Response CreateOrUpdateMarketplaceAgreement(Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementAsync(Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdateMarketplaceAgreementsOperationGroup(Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(Azure.ResourceManager.Datadog.Models.DatadogAgreementResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCreationSupportedOperationGroup(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCreationSupportedOperationGroupAsync(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetCreationSupportedOperationGroups(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetCreationSupportedOperationGroupsAsync(string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDatadogMonitorResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDatadogMonitorResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetMarketplaceAgreements(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMarketplaceAgreementsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetMarketplaceAgreementsOperationGroups(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMarketplaceAgreementsOperationGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableDatadogTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableDatadogTenantResource() { } + public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Datadog.Models { public static partial class ArmDatadogModelFactory { - public static Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties DatadogAgreementResourceProperties(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.DatadogAgreementProperties properties = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.BillingInfoResult BillingInfoResult(Azure.ResourceManager.Datadog.Models.MarketplaceSaaSInfo marketplaceSaasInfo = null, Azure.ResourceManager.Datadog.Models.PartnerBillingEntity partnerBillingEntity = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties CreateResourceSupportedProperties(string name = null, bool? creationSupported = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResult CreateResourceSupportedResult(Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties properties = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.DatadogAgreementResource DatadogAgreementResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.DatadogAgreementProperties properties = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogHost DatadogHost(string name = null, System.Collections.Generic.IEnumerable aliases = null, System.Collections.Generic.IEnumerable apps = null, Azure.ResourceManager.Datadog.Models.DatadogHostMetadata meta = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogHostMetadata DatadogHostMetadata(string agentVersion = null, Azure.ResourceManager.Datadog.Models.DatadogInstallMethod installMethod = null, string logsAgentTransport = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogInstallMethod DatadogInstallMethod(string tool = null, string toolVersion = null, string installerVersion = null) { throw null; } public static Azure.ResourceManager.Datadog.DatadogMonitorResourceData DatadogMonitorResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string skuName = null, Azure.ResourceManager.Datadog.Models.MonitorProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.DatadogOrganizationProperties DatadogOrganizationProperties(string name = null, string id = null, string linkingAuthCode = null, string linkingClientId = null, System.Uri redirectUri = null, string apiKey = null, string applicationKey = null, string enterpriseAppId = null) { throw null; } public static Azure.ResourceManager.Datadog.Models.DatadogSetPasswordLink DatadogSetPasswordLink(string setPasswordLink = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties DatadogSingleSignOnProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.SingleSignOnState? singleSignOnState = default(Azure.ResourceManager.Datadog.Models.SingleSignOnState?), string enterpriseAppId = null, System.Uri singleSignOnUri = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties DatadogSingleSignOnProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.SingleSignOnState? singleSignOnState = default(Azure.ResourceManager.Datadog.Models.SingleSignOnState?), string enterpriseAppId = null, string singleSignOnUri = null) { throw null; } public static Azure.ResourceManager.Datadog.DatadogSingleSignOnResourceData DatadogSingleSignOnResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties properties = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.MonitoredResourceContent MonitoredResourceContent(string id = null, bool? sendingMetrics = default(bool?), string reasonForMetricsStatus = null, bool? sendingLogs = default(bool?), string reasonForLogsStatus = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.LinkedResource LinkedResource(string id = null, string location = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.MarketplaceSaaSInfo MarketplaceSaaSInfo(string marketplaceSubscriptionId = null, string marketplaceName = null, string marketplaceStatus = null, string billedAzureSubscriptionId = null, bool? subscribed = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.MonitoredResource MonitoredResource(string id = null, bool? sendingMetrics = default(bool?), string reasonForMetricsStatus = null, bool? sendingLogs = default(bool?), string reasonForLogsStatus = null) { throw null; } + public static Azure.ResourceManager.Datadog.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.Datadog.Models.SubscriptionList properties = null) { throw null; } public static Azure.ResourceManager.Datadog.MonitoringTagRuleData MonitoringTagRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties properties = null) { throw null; } - public static Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties MonitoringTagRulesProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.LogRules logRules = null, System.Collections.Generic.IEnumerable metricRulesFilteringTags = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties MonitoringTagRulesProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.LogRules logRules = null, System.Collections.Generic.IEnumerable metricRulesFilteringTags = null, bool? automuting = default(bool?), bool? customMetrics = default(bool?)) { throw null; } public static Azure.ResourceManager.Datadog.Models.MonitorProperties MonitorProperties(Azure.ResourceManager.Datadog.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Datadog.Models.ProvisioningState?), Azure.ResourceManager.Datadog.Models.MonitoringStatus? monitoringStatus = default(Azure.ResourceManager.Datadog.Models.MonitoringStatus?), Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus?), Azure.ResourceManager.Datadog.Models.DatadogOrganizationProperties datadogOrganizationProperties = null, Azure.ResourceManager.Datadog.Models.UserInfo userInfo = null, Azure.ResourceManager.Datadog.Models.LiftrResourceCategory? liftrResourceCategory = default(Azure.ResourceManager.Datadog.Models.LiftrResourceCategory?), int? liftrResourcePreference = default(int?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) { throw null; } + public static Azure.ResourceManager.Datadog.Models.OperationResult OperationResult(string name = null, Azure.ResourceManager.Datadog.Models.OperationDisplay display = null, bool? isDataAction = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.PartnerBillingEntity PartnerBillingEntity(string id = null, string name = null, string partnerEntityUri = null) { throw null; } + } + public partial class BillingInfoResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BillingInfoResult() { } + public Azure.ResourceManager.Datadog.Models.MarketplaceSaaSInfo MarketplaceSaasInfo { get { throw null; } } + public Azure.ResourceManager.Datadog.Models.PartnerBillingEntity PartnerBillingEntity { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } + } + public partial class CreateResourceSupportedProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CreateResourceSupportedProperties() { } + public bool? CreationSupported { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateResourceSupportedResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CreateResourceSupportedResult() { } + public Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties Properties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DatadogAgreementProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -250,16 +363,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DatadogAgreementResourceProperties : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DatadogAgreementResource : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DatadogAgreementResourceProperties() { } + public DatadogAgreementResource() { } public Azure.ResourceManager.Datadog.Models.DatadogAgreementProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.DatadogAgreementResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Datadog.Models.DatadogAgreementResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.DatadogAgreementResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DatadogApiKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -318,7 +431,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class DatadogMonitorResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DatadogMonitorResourcePatch() { } - public Azure.ResourceManager.Datadog.Models.MonitoringStatus? MonitorUpdateMonitoringStatus { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitorUpdateProperties Properties { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -333,12 +446,13 @@ public partial class DatadogOrganizationProperties : System.ClientModel.Primitiv public DatadogOrganizationProperties() { } public string ApiKey { get { throw null; } set { } } public string ApplicationKey { get { throw null; } set { } } + public bool? Cspm { get { throw null; } set { } } public string EnterpriseAppId { get { throw null; } set { } } - public string Id { get { throw null; } } + public string Id { get { throw null; } set { } } public string LinkingAuthCode { get { throw null; } set { } } public string LinkingClientId { get { throw null; } set { } } - public string Name { get { throw null; } } - public System.Uri RedirectUri { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string RedirectUri { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Datadog.Models.DatadogOrganizationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -363,7 +477,7 @@ public DatadogSingleSignOnProperties() { } public string EnterpriseAppId { get { throw null; } set { } } public Azure.ResourceManager.Datadog.Models.ProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Datadog.Models.SingleSignOnState? SingleSignOnState { get { throw null; } set { } } - public System.Uri SingleSignOnUri { get { throw null; } } + public string SingleSignOnUri { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -402,6 +516,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Datadog.Models.LiftrResourceCategory left, Azure.ResourceManager.Datadog.Models.LiftrResourceCategory right) { throw null; } public override string ToString() { throw null; } } + public partial class LinkedResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LinkedResource() { } + public string Id { get { throw null; } } + public string Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.LinkedResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.LinkedResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LogRules : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LogRules() { } @@ -416,6 +542,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MarketplaceSaaSInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketplaceSaaSInfo() { } + public string BilledAzureSubscriptionId { get { throw null; } } + public string MarketplaceName { get { throw null; } } + public string MarketplaceStatus { get { throw null; } } + public string MarketplaceSubscriptionId { get { throw null; } } + public bool? Subscribed { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable { @@ -436,20 +577,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.Datadog.Models.MarketplaceSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class MonitoredResourceContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class MonitoredResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitoredResourceContent() { } + internal MonitoredResource() { } public string Id { get { throw null; } } public string ReasonForLogsStatus { get { throw null; } } public string ReasonForMetricsStatus { get { throw null; } } public bool? SendingLogs { get { throw null; } } public bool? SendingMetrics { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.MonitoredResourceContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Datadog.Models.MonitoredResourceContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Datadog.Models.MonitoredResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.MonitoredResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(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(string subscriptionId) { } + public string Error { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.Status? Status { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitoringTagRulesProperties TagRules { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MonitoringStatus : System.IEquatable @@ -472,6 +627,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MonitoringTagRulesProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MonitoringTagRulesProperties() { } + public bool? Automuting { get { throw null; } set { } } + public bool? CustomMetrics { get { throw null; } set { } } public Azure.ResourceManager.Datadog.Models.LogRules LogRules { get { throw null; } set { } } public System.Collections.Generic.IList MetricRulesFilteringTags { get { throw null; } } public Azure.ResourceManager.Datadog.Models.ProvisioningState? ProvisioningState { get { throw null; } } @@ -499,6 +656,79 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MonitorUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorUpdateProperties() { } + public bool? Cspm { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitoringStatus? MonitoringStatus { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.MonitorUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.MonitorUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 Operation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Operation(string value) { throw null; } + public static Azure.ResourceManager.Datadog.Models.Operation Active { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation AddBegin { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation AddComplete { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation DeleteBegin { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Operation DeleteComplete { get { throw null; } } + public bool Equals(Azure.ResourceManager.Datadog.Models.Operation 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.Datadog.Models.Operation left, Azure.ResourceManager.Datadog.Models.Operation right) { throw null; } + public static implicit operator Azure.ResourceManager.Datadog.Models.Operation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Datadog.Models.Operation left, Azure.ResourceManager.Datadog.Models.Operation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OperationDisplay : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDisplay() { } + public string Description { get { throw null; } } + public string Operation { get { throw null; } } + public string Provider { get { throw null; } } + public string Resource { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationDisplay System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationDisplay System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OperationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationResult() { } + public Azure.ResourceManager.Datadog.Models.OperationDisplay Display { get { throw null; } } + public bool? IsDataAction { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.Models.OperationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(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 Id { get { throw null; } } + public string Name { get { throw null; } } + public string PartnerEntityUri { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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 ProvisioningState : System.IEquatable { @@ -545,6 +775,38 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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.Datadog.Models.Status Active { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Status Deleting { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Status Failed { get { throw null; } } + public static Azure.ResourceManager.Datadog.Models.Status InProgress { get { throw null; } } + public bool Equals(Azure.ResourceManager.Datadog.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.Datadog.Models.Status left, Azure.ResourceManager.Datadog.Models.Status right) { throw null; } + public static implicit operator Azure.ResourceManager.Datadog.Models.Status (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Datadog.Models.Status left, Azure.ResourceManager.Datadog.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.Datadog.Models.Operation? Operation { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Datadog.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.Datadog.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; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct TagAction : System.IEquatable { private readonly object _dummy; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogMonitorResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogMonitorResource.cs similarity index 74% rename from sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogMonitorResource.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogMonitorResource.cs index 015ee8b55719..8eab823f577c 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogMonitorResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogMonitorResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.Datadog.Models; -using Azure.ResourceManager.Resources.Models; using NUnit.Framework; namespace Azure.ResourceManager.Datadog.Samples @@ -21,8 +20,8 @@ public partial class Sample_DatadogMonitorResource [Ignore("Only validating compilation of examples")] public async Task Get_MonitorsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json - // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Get.json + // this example is just showing the usage of "DatadogMonitorResource_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(); @@ -51,8 +50,8 @@ public async Task Get_MonitorsGet() [Ignore("Only validating compilation of examples")] public async Task Delete_MonitorsDelete() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Delete.json - // this example is just showing the usage of "Monitors_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Delete.json + // this example is just showing the usage of "DatadogMonitorResource_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(); @@ -77,8 +76,8 @@ public async Task Delete_MonitorsDelete() [Ignore("Only validating compilation of examples")] public async Task Update_MonitorsUpdate() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Update.json - // this example is just showing the usage of "Monitors_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Update.json + // this example is just showing the usage of "DatadogMonitorResource_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(); @@ -94,23 +93,28 @@ public async Task Update_MonitorsUpdate() DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); // invoke the operation - DatadogMonitorResourcePatch patch = new DatadogMonitorResourcePatch(); - ArmOperation lro = await datadogMonitorResource.UpdateAsync(WaitUntil.Completed, patch); - DatadogMonitorResource result = lro.Value; + DatadogMonitorResourcePatch patch = new DatadogMonitorResourcePatch + { + Properties = new MonitorUpdateProperties + { + MonitoringStatus = MonitoringStatus.Enabled, + }, + Tags = +{ +["Environment"] = "Dev" +}, + }; + await datadogMonitorResource.UpdateAsync(WaitUntil.Completed, patch); - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DatadogMonitorResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + Console.WriteLine("Succeeded"); } [Test] [Ignore("Only validating compilation of examples")] public async Task GetApiKeys_MonitorsListApiKeys() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_List.json - // this example is just showing the usage of "Monitors_ListApiKeys" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/ApiKeys_List.json + // this example is just showing the usage of "DatadogMonitorResources_ListApiKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -138,8 +142,8 @@ public async Task GetApiKeys_MonitorsListApiKeys() [Ignore("Only validating compilation of examples")] public async Task GetDefaultKey_MonitorsGetDefaultKey() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_GetDefaultKey.json - // this example is just showing the usage of "Monitors_GetDefaultKey" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/ApiKeys_GetDefaultKey.json + // this example is just showing the usage of "DatadogMonitorResources_GetDefaultKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -164,8 +168,8 @@ public async Task GetDefaultKey_MonitorsGetDefaultKey() [Ignore("Only validating compilation of examples")] public async Task SetDefaultKey_MonitorsSetDefaultKey() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_SetDefaultKey.json - // this example is just showing the usage of "Monitors_SetDefaultKey" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/ApiKeys_SetDefaultKey.json + // this example is just showing the usage of "DatadogMonitorResources_SetDefaultKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -181,7 +185,8 @@ public async Task SetDefaultKey_MonitorsSetDefaultKey() DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); // invoke the operation - await datadogMonitorResource.SetDefaultKeyAsync(); + DatadogApiKey body = new DatadogApiKey("1111111111111111aaaaaaaaaaaaaaaa"); + await datadogMonitorResource.SetDefaultKeyAsync(body: body); Console.WriteLine("Succeeded"); } @@ -190,8 +195,8 @@ public async Task SetDefaultKey_MonitorsSetDefaultKey() [Ignore("Only validating compilation of examples")] public async Task GetHosts_MonitorsListHosts() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Hosts_List.json - // this example is just showing the usage of "Monitors_ListHosts" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Hosts_List.json + // this example is just showing the usage of "DatadogMonitorResources_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 TokenCredential cred = new DefaultAzureCredential(); @@ -219,8 +224,8 @@ public async Task GetHosts_MonitorsListHosts() [Ignore("Only validating compilation of examples")] public async Task GetLinkedResources_MonitorsListLinkedResources() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-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. + // Generated from example definition: 2023-10-20/LinkedResources_List.json + // this example is just showing the usage of "DatadogMonitorResources_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(); @@ -236,7 +241,7 @@ public async Task GetLinkedResources_MonitorsListLinkedResources() DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); // invoke the operation and iterate over the result - await foreach (SubResource item in datadogMonitorResource.GetLinkedResourcesAsync()) + await foreach (LinkedResource item in datadogMonitorResource.GetLinkedResourcesAsync()) { Console.WriteLine($"Succeeded: {item}"); } @@ -248,8 +253,8 @@ public async Task GetLinkedResources_MonitorsListLinkedResources() [Ignore("Only validating compilation of examples")] public async Task GetMonitoredResources_MonitorsListMonitoredResources() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MonitoredResources_List.json - // this example is just showing the usage of "Monitors_ListMonitoredResources" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/MonitoredResources_List.json + // this example is just showing the usage of "DatadogMonitorResources_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 TokenCredential cred = new DefaultAzureCredential(); @@ -265,7 +270,7 @@ public async Task GetMonitoredResources_MonitorsListMonitoredResources() DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); // invoke the operation and iterate over the result - await foreach (MonitoredResourceContent item in datadogMonitorResource.GetMonitoredResourcesAsync()) + await foreach (MonitoredResource item in datadogMonitorResource.GetMonitoredResourcesAsync()) { Console.WriteLine($"Succeeded: {item}"); } @@ -277,8 +282,8 @@ public async Task GetMonitoredResources_MonitorsListMonitoredResources() [Ignore("Only validating compilation of examples")] public async Task RefreshSetPasswordLink_MonitorsRefreshSetPasswordLink() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/RefreshSetPassword_Get.json - // this example is just showing the usage of "Monitors_RefreshSetPasswordLink" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/RefreshSetPassword_Get.json + // this example is just showing the usage of "DatadogMonitorResources_RefreshSetPasswordLink" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -298,5 +303,31 @@ public async Task RefreshSetPasswordLink_MonitorsRefreshSetPasswordLink() Console.WriteLine($"Succeeded: {result}"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task BillingInfoGet_BillingInfoGet() + { + // Generated from example definition: 2023-10-20/BillingInfo_Get.json + // this example is just showing the usage of "DatadogMonitorResources_BillingInfoGet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DatadogMonitorResource created on azure + // for more information of creating DatadogMonitorResource, please refer to the document of DatadogMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier datadogMonitorResourceId = DatadogMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); + + // invoke the operation + BillingInfoResult result = await datadogMonitorResource.BillingInfoGetAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs similarity index 80% rename from sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs index 85dc7891b709..83a3ca7eea87 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogMonitorResourceCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Datadog.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -20,8 +21,8 @@ public partial class Sample_DatadogMonitorResourceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_MonitorsCreate() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Create.json - // this example is just showing the usage of "Monitors_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Create.json + // this example is just showing the usage of "DatadogMonitorResource_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -40,7 +41,33 @@ public async Task CreateOrUpdate_MonitorsCreate() // invoke the operation string monitorName = "myMonitor"; - DatadogMonitorResourceData data = new DatadogMonitorResourceData(default); + DatadogMonitorResourceData data = new DatadogMonitorResourceData(new AzureLocation("West US")) + { + SkuName = "free_Monthly", + Properties = new MonitorProperties + { + MonitoringStatus = MonitoringStatus.Enabled, + DatadogOrganizationProperties = new DatadogOrganizationProperties + { + Name = "myOrg", + Id = "myOrg123", + LinkingAuthCode = "someAuthCode", + LinkingClientId = "00000000-0000-0000-0000-000000000000", + EnterpriseAppId = "00000000-0000-0000-0000-000000000000", + Cspm = false, + }, + UserInfo = new UserInfo + { + Name = "Alice", + EmailAddress = "alice@microsoft.com", + PhoneNumber = "123-456-7890", + }, + }, + Tags = +{ +["Environment"] = "Dev" +}, + }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, monitorName, data); DatadogMonitorResource result = lro.Value; @@ -55,8 +82,8 @@ public async Task CreateOrUpdate_MonitorsCreate() [Ignore("Only validating compilation of examples")] public async Task Get_MonitorsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json - // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Get.json + // this example is just showing the usage of "DatadogMonitorResource_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(); @@ -88,8 +115,8 @@ public async Task Get_MonitorsGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_MonitorsListByResourceGroup() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_ListByResourceGroup.json - // this example is just showing the usage of "Monitors_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_ListByResourceGroup.json + // this example is just showing the usage of "DatadogMonitorResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -123,8 +150,8 @@ public async Task GetAll_MonitorsListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_MonitorsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json - // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Get.json + // this example is just showing the usage of "DatadogMonitorResource_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(); @@ -152,8 +179,8 @@ public async Task Exists_MonitorsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_MonitorsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json - // this example is just showing the usage of "Monitors_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/Monitors_Get.json + // this example is just showing the usage of "DatadogMonitorResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogSingleSignOnResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogSingleSignOnResource.cs similarity index 82% rename from sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogSingleSignOnResource.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogSingleSignOnResource.cs index b5aa9f9d097e..83caa2c84801 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogSingleSignOnResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogSingleSignOnResource.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Datadog.Models; using NUnit.Framework; namespace Azure.ResourceManager.Datadog.Samples @@ -19,8 +20,8 @@ public partial class Sample_DatadogSingleSignOnResource [Ignore("Only validating compilation of examples")] public async Task Get_SingleSignOnConfigurationsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json - // this example is just showing the usage of "SingleSignOnConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_Get.json + // this example is just showing the usage of "DatadogSingleSignOnResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,8 +51,8 @@ public async Task Get_SingleSignOnConfigurationsGet() [Ignore("Only validating compilation of examples")] public async Task Update_SingleSignOnConfigurationsCreateOrUpdate() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json - // this example is just showing the usage of "SingleSignOnConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_CreateOrUpdate.json + // this example is just showing the usage of "DatadogSingleSignOnResource_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(); @@ -68,7 +69,14 @@ public async Task Update_SingleSignOnConfigurationsCreateOrUpdate() DatadogSingleSignOnResource datadogSingleSignOnResource = client.GetDatadogSingleSignOnResource(datadogSingleSignOnResourceId); // invoke the operation - DatadogSingleSignOnResourceData data = new DatadogSingleSignOnResourceData(); + DatadogSingleSignOnResourceData data = new DatadogSingleSignOnResourceData + { + Properties = new DatadogSingleSignOnProperties + { + SingleSignOnState = SingleSignOnState.Enable, + EnterpriseAppId = "00000000-0000-0000-0000-000000000000", + }, + }; ArmOperation lro = await datadogSingleSignOnResource.UpdateAsync(WaitUntil.Completed, data); DatadogSingleSignOnResource result = lro.Value; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs similarity index 85% rename from sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs index fd2ee71a0950..5b0837e985db 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_DatadogSingleSignOnResourceCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Datadog.Models; using NUnit.Framework; namespace Azure.ResourceManager.Datadog.Samples @@ -19,8 +20,8 @@ public partial class Sample_DatadogSingleSignOnResourceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SingleSignOnConfigurationsCreateOrUpdate() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json - // this example is just showing the usage of "SingleSignOnConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_CreateOrUpdate.json + // this example is just showing the usage of "DatadogSingleSignOnResource_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(); @@ -40,7 +41,14 @@ public async Task CreateOrUpdate_SingleSignOnConfigurationsCreateOrUpdate() // invoke the operation string configurationName = "default"; - DatadogSingleSignOnResourceData data = new DatadogSingleSignOnResourceData(); + DatadogSingleSignOnResourceData data = new DatadogSingleSignOnResourceData + { + Properties = new DatadogSingleSignOnProperties + { + SingleSignOnState = SingleSignOnState.Enable, + EnterpriseAppId = "00000000-0000-0000-0000-000000000000", + }, + }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, data); DatadogSingleSignOnResource result = lro.Value; @@ -55,8 +63,8 @@ public async Task CreateOrUpdate_SingleSignOnConfigurationsCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_SingleSignOnConfigurationsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json - // this example is just showing the usage of "SingleSignOnConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_Get.json + // this example is just showing the usage of "DatadogSingleSignOnResource_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(); @@ -89,8 +97,8 @@ public async Task Get_SingleSignOnConfigurationsGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_SingleSignOnConfigurationsList() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_List.json - // this example is just showing the usage of "SingleSignOnConfigurations_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_List.json + // this example is just showing the usage of "DatadogSingleSignOnResource_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(); @@ -125,8 +133,8 @@ public async Task GetAll_SingleSignOnConfigurationsList() [Ignore("Only validating compilation of examples")] public async Task Exists_SingleSignOnConfigurationsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json - // this example is just showing the usage of "SingleSignOnConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_Get.json + // this example is just showing the usage of "DatadogSingleSignOnResource_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(); @@ -155,8 +163,8 @@ public async Task Exists_SingleSignOnConfigurationsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SingleSignOnConfigurationsGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json - // this example is just showing the usage of "SingleSignOnConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/SingleSignOnConfigurations_Get.json + // this example is just showing the usage of "DatadogSingleSignOnResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs new file mode 100644 index 000000000000..c8dc706faafb --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyCollection.cs @@ -0,0 +1,249 @@ +// 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.Datadog.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Datadog.Samples +{ + public partial class Sample_MonitoredSubscriptionPropertyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_MonitorsAddMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_CreateorUpdate.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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 DatadogMonitorResource created on azure + // for more information of creating DatadogMonitorResource, please refer to the document of DatadogMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier datadogMonitorResourceId = DatadogMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = datadogMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + string configurationName = "default"; + MonitoredSubscriptionPropertyData data = new MonitoredSubscriptionPropertyData + { + Properties = new SubscriptionList + { + Operation = Models.Operation.AddBegin, + MonitoredSubscriptionList = {new MonitoredSubscription("/subscriptions/00000000-0000-0000-0000-000000000000") +{ +Status = Status.Active, +TagRules = new MonitoringTagRulesProperties +{ +LogRules = new LogRules +{ +SendAadLogs = false, +SendSubscriptionLogs = true, +SendResourceLogs = true, +FilteringTags = {new FilteringTag +{ +Name = "Environment", +Value = "Prod", +Action = TagAction.Include, +}, new FilteringTag +{ +Name = "Environment", +Value = "Dev", +Action = TagAction.Exclude, +}}, +}, +MetricRulesFilteringTags = {}, +Automuting = true, +}, +}, new MonitoredSubscription("/subscriptions/00000000-0000-0000-0000-000000000001") +{ +Status = Status.Failed, +TagRules = new MonitoringTagRulesProperties +{ +LogRules = new LogRules +{ +SendAadLogs = false, +SendSubscriptionLogs = true, +SendResourceLogs = true, +FilteringTags = {new FilteringTag +{ +Name = "Environment", +Value = "Prod", +Action = TagAction.Include, +}, new FilteringTag +{ +Name = "Environment", +Value = "Dev", +Action = TagAction.Exclude, +}}, +}, +MetricRulesFilteringTags = {}, +Automuting = true, +}, +}}, + }, + }; + await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, data); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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 DatadogMonitorResource created on azure + // for more information of creating DatadogMonitorResource, please refer to the document of DatadogMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier datadogMonitorResourceId = DatadogMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = datadogMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + string 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}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_List.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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 DatadogMonitorResource created on azure + // for more information of creating DatadogMonitorResource, please refer to the document of DatadogMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier datadogMonitorResourceId = DatadogMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = datadogMonitorResource.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"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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 DatadogMonitorResource created on azure + // for more information of creating DatadogMonitorResource, please refer to the document of DatadogMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier datadogMonitorResourceId = DatadogMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = datadogMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + string configurationName = "default"; + bool result = await collection.ExistsAsync(configurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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 DatadogMonitorResource created on azure + // for more information of creating DatadogMonitorResource, please refer to the document of DatadogMonitorResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string monitorName = "myMonitor"; + ResourceIdentifier datadogMonitorResourceId = DatadogMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName); + DatadogMonitorResource datadogMonitorResource = client.GetDatadogMonitorResource(datadogMonitorResourceId); + + // get the collection of this MonitoredSubscriptionPropertyResource + MonitoredSubscriptionPropertyCollection collection = datadogMonitorResource.GetMonitoredSubscriptionProperties(); + + // invoke the operation + string 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}"); + } + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs new file mode 100644 index 000000000000..7288aa18d8d6 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoredSubscriptionPropertyResource.cs @@ -0,0 +1,167 @@ +// 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.Datadog.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Datadog.Samples +{ + public partial class Sample_MonitoredSubscriptionPropertyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MonitorsGetMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_Get.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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"; + string 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}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_MonitorsDeleteMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_Delete.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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"; + string 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"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_MonitorsUpdateMonitoredSubscriptions() + { + // Generated from example definition: 2023-10-20/MonitoredSubscriptions_Update.json + // this example is just showing the usage of "MonitoredSubscriptionProperties_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"; + string configurationName = "default"; + ResourceIdentifier monitoredSubscriptionPropertyResourceId = MonitoredSubscriptionPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName, configurationName); + MonitoredSubscriptionPropertyResource monitoredSubscriptionProperty = client.GetMonitoredSubscriptionPropertyResource(monitoredSubscriptionPropertyResourceId); + + // invoke the operation + MonitoredSubscriptionPropertyData data = new MonitoredSubscriptionPropertyData + { + Properties = new SubscriptionList + { + Operation = Models.Operation.AddComplete, + MonitoredSubscriptionList = {new MonitoredSubscription("/subscriptions/00000000-0000-0000-0000-000000000000") +{ +Status = Status.Active, +TagRules = new MonitoringTagRulesProperties +{ +LogRules = new LogRules +{ +SendAadLogs = false, +SendSubscriptionLogs = true, +SendResourceLogs = true, +FilteringTags = {new FilteringTag +{ +Name = "Environment", +Value = "Prod", +Action = TagAction.Include, +}, new FilteringTag +{ +Name = "Environment", +Value = "Dev", +Action = TagAction.Exclude, +}}, +}, +MetricRulesFilteringTags = {}, +Automuting = true, +}, +}, new MonitoredSubscription("/subscriptions/00000000-0000-0000-0000-000000000001") +{ +Status = Status.Failed, +TagRules = new MonitoringTagRulesProperties +{ +LogRules = new LogRules +{ +SendAadLogs = false, +SendSubscriptionLogs = true, +SendResourceLogs = true, +FilteringTags = {new FilteringTag +{ +Name = "Environment", +Value = "Prod", +Action = TagAction.Include, +}, new FilteringTag +{ +Name = "Environment", +Value = "Dev", +Action = TagAction.Exclude, +}}, +}, +MetricRulesFilteringTags = {}, +Automuting = true, +}, +}}, + }, + }; + 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}"); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_MonitoringTagRuleCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoringTagRuleCollection.cs similarity index 84% rename from sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_MonitoringTagRuleCollection.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoringTagRuleCollection.cs index 88fdab415ea4..6b7ac3026b69 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_MonitoringTagRuleCollection.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoringTagRuleCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Datadog.Models; using NUnit.Framework; namespace Azure.ResourceManager.Datadog.Samples @@ -19,8 +20,8 @@ public partial class Sample_MonitoringTagRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_TagRulesCreateOrUpdate() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_CreateOrUpdate.json - // this example is just showing the usage of "TagRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_CreateOrUpdate.json + // this example is just showing the usage of "MonitoringTagRules_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(); @@ -40,7 +41,31 @@ public async Task CreateOrUpdate_TagRulesCreateOrUpdate() // invoke the operation string ruleSetName = "default"; - MonitoringTagRuleData data = new MonitoringTagRuleData(); + MonitoringTagRuleData data = new MonitoringTagRuleData + { + Properties = new MonitoringTagRulesProperties + { + LogRules = new LogRules + { + SendAadLogs = false, + SendSubscriptionLogs = true, + SendResourceLogs = true, + FilteringTags = {new FilteringTag +{ +Name = "Environment", +Value = "Prod", +Action = TagAction.Include, +}, new FilteringTag +{ +Name = "Environment", +Value = "Dev", +Action = TagAction.Exclude, +}}, + }, + MetricRulesFilteringTags = { }, + Automuting = true, + }, + }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, ruleSetName, data); MonitoringTagRuleResource result = lro.Value; @@ -55,8 +80,8 @@ public async Task CreateOrUpdate_TagRulesCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_TagRulesGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json - // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_Get.json + // this example is just showing the usage of "MonitoringTagRules_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(); @@ -89,8 +114,8 @@ public async Task Get_TagRulesGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_TagRulesList() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_List.json - // this example is just showing the usage of "TagRules_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_List.json + // this example is just showing the usage of "MonitoringTagRules_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(); @@ -125,8 +150,8 @@ public async Task GetAll_TagRulesList() [Ignore("Only validating compilation of examples")] public async Task Exists_TagRulesGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json - // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_Get.json + // this example is just showing the usage of "MonitoringTagRules_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(); @@ -155,8 +180,8 @@ public async Task Exists_TagRulesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_TagRulesGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json - // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_Get.json + // this example is just showing the usage of "MonitoringTagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_MonitoringTagRuleResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoringTagRuleResource.cs similarity index 76% rename from sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_MonitoringTagRuleResource.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoringTagRuleResource.cs index 4fd2ac3d570f..9aaa440010eb 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_MonitoringTagRuleResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_MonitoringTagRuleResource.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Datadog.Models; using NUnit.Framework; namespace Azure.ResourceManager.Datadog.Samples @@ -19,8 +20,8 @@ public partial class Sample_MonitoringTagRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_TagRulesGet() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json - // this example is just showing the usage of "TagRules_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_Get.json + // this example is just showing the usage of "MonitoringTagRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,8 +51,8 @@ public async Task Get_TagRulesGet() [Ignore("Only validating compilation of examples")] public async Task Update_TagRulesCreateOrUpdate() { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_CreateOrUpdate.json - // this example is just showing the usage of "TagRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-10-20/TagRules_CreateOrUpdate.json + // this example is just showing the usage of "MonitoringTagRules_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(); @@ -68,7 +69,31 @@ public async Task Update_TagRulesCreateOrUpdate() MonitoringTagRuleResource monitoringTagRule = client.GetMonitoringTagRuleResource(monitoringTagRuleResourceId); // invoke the operation - MonitoringTagRuleData data = new MonitoringTagRuleData(); + MonitoringTagRuleData data = new MonitoringTagRuleData + { + Properties = new MonitoringTagRulesProperties + { + LogRules = new LogRules + { + SendAadLogs = false, + SendSubscriptionLogs = true, + SendResourceLogs = true, + FilteringTags = {new FilteringTag +{ +Name = "Environment", +Value = "Prod", +Action = TagAction.Include, +}, new FilteringTag +{ +Name = "Environment", +Value = "Dev", +Action = TagAction.Exclude, +}}, + }, + MetricRulesFilteringTags = { }, + Automuting = true, + }, + }; ArmOperation lro = await monitoringTagRule.UpdateAsync(WaitUntil.Completed, data); MonitoringTagRuleResource result = lro.Value; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..5ea42fe6b1c1 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,162 @@ +// 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.Datadog.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Datadog.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDatadogMonitorResources_MonitorsList() + { + // Generated from example definition: 2023-10-20/Monitors_List.json + // this example is just showing the usage of "DatadogMonitorResource_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "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 (DatadogMonitorResource item in subscriptionResource.GetDatadogMonitorResourcesAsync()) + { + // 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 + DatadogMonitorResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetMarketplaceAgreementsOperationGroups_MarketplaceAgreementsList() + { + // Generated from example definition: 2023-10-20/MarketplaceAgreements_List.json + // this example is just showing the usage of "MarketplaceAgreementsOperationGroup_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "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 (DatadogAgreementResource item in subscriptionResource.GetMarketplaceAgreementsOperationGroupsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdateMarketplaceAgreementsOperationGroup_MarketplaceAgreementsCreateOrUpdate() + { + // Generated from example definition: 2023-10-20/MarketplaceAgreements_Create.json + // this example is just showing the usage of "MarketplaceAgreementsOperationGroup_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + DatadogAgreementResource body = new DatadogAgreementResource + { + Properties = new DatadogAgreementProperties + { + Accepted = true, + }, + }; + DatadogAgreementResource result = await subscriptionResource.CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(body); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCreationSupportedOperationGroups_CreationSupportedList() + { + // Generated from example definition: 2023-10-20/CreationSupported_List.json + // this example is just showing the usage of "CreationSupportedOperationGroup_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + string datadogOrganizationId = "00000000-0000-0000-0000"; + await foreach (CreateResourceSupportedResult item in subscriptionResource.GetCreationSupportedOperationGroupsAsync(datadogOrganizationId)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCreationSupportedOperationGroup_CreationSupportedGet() + { + // Generated from example definition: 2023-10-20/CreationSupported_Get.json + // this example is just showing the usage of "CreationSupportedOperationGroup_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string datadogOrganizationId = "00000000-0000-0000-0000"; + CreateResourceSupportedResult result = await subscriptionResource.GetCreationSupportedOperationGroupAsync(datadogOrganizationId); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_TenantResourceExtensions.cs new file mode 100644 index 000000000000..4a67a53ed6e9 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Datadog.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Datadog.Samples +{ + public partial class Sample_TenantResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperations_OperationsList() + { + // Generated from example definition: 2023-10-20/Operations_List.json + // this example is just showing the usage of "Operations_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + TenantResource tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; + + // invoke the operation and iterate over the result + await foreach (OperationResult item in tenantResource.GetOperationsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs index ec461eb700bc..a7a72177be9f 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs @@ -16,27 +16,80 @@ namespace Azure.ResourceManager.Datadog.Models /// Model factory for models. public static partial class ArmDatadogModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . + /// Operation name, i.e., {provider}/{resource}/{operation}. + /// The object that represents the operation. + /// Indicates whether the operation is a data action. + /// A new instance for mocking. + public static OperationResult OperationResult(string name = null, OperationDisplay display = null, bool? isDataAction = null) + { + return new OperationResult(name, display, isDataAction, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The service provider: Microsoft.Datadog. + /// The resource on which the operation is performed. + /// The type of operation: create, update, delete, etc. + /// A localized description of the operation. + /// A new instance for mocking. + public static OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) + { + return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Represents the properties of the resource. - /// A new instance for mocking. - public static DatadogAgreementResourceProperties DatadogAgreementResourceProperties(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DatadogAgreementProperties properties = null) + /// The tags. + /// The location. + /// + /// Properties specific to the monitor resource. + /// Gets or sets the identity. Current supported identity types: SystemAssigned, UserAssigned. + /// A new instance for mocking. + public static DatadogMonitorResourceData DatadogMonitorResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string skuName = null, MonitorProperties properties = null, ManagedServiceIdentity identity = null) { - return new DatadogAgreementResourceProperties( + tags ??= new Dictionary(); + + return new DatadogMonitorResourceData( id, name, resourceType, systemData, + tags, + location, + skuName != null ? new ResourceSku(skuName, serializedAdditionalRawData: null) : null, properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Flag specifying if the resource monitoring is enabled or disabled. + /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. + /// Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. + /// Includes name, email and optionally, phone number. User Information can't be null. + /// + /// The priority of the resource. + /// A new instance for mocking. + public static MonitorProperties MonitorProperties(ProvisioningState? provisioningState = null, MonitoringStatus? monitoringStatus = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, DatadogOrganizationProperties datadogOrganizationProperties = null, UserInfo userInfo = null, LiftrResourceCategory? liftrResourceCategory = null, int? liftrResourcePreference = null) + { + return new MonitorProperties( + provisioningState, + monitoringStatus, + marketplaceSubscriptionStatus, + datadogOrganizationProperties, + userInfo, + liftrResourceCategory, + liftrResourcePreference, serializedAdditionalRawData: null); } /// Initializes a new instance of . /// The name of the host. - /// The aliases for the host. + /// The aliases for the host installed via the Datadog agent. /// The Datadog integrations reporting metrics for the host. /// /// A new instance for mocking. @@ -68,16 +121,25 @@ public static DatadogInstallMethod DatadogInstallMethod(string tool = null, stri return new DatadogInstallMethod(tool, toolVersion, installerVersion, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The ARM id of the linked resource. + /// The location of the linked resource. + /// A new instance for mocking. + public static LinkedResource LinkedResource(string id = null, string location = null) + { + return new LinkedResource(id, location, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The ARM id of the resource. /// Flag indicating if resource is sending metrics to Datadog. /// Reason for why the resource is sending metrics (or why it is not sending). /// Flag indicating if resource is sending logs to Datadog. /// Reason for why the resource is sending logs (or why it is not sending). - /// A new instance for mocking. - public static MonitoredResourceContent MonitoredResourceContent(string id = null, bool? sendingMetrics = null, string reasonForMetricsStatus = null, bool? sendingLogs = null, string reasonForLogsStatus = null) + /// A new instance for mocking. + public static MonitoredResource MonitoredResource(string id = null, bool? sendingMetrics = null, string reasonForMetricsStatus = null, bool? sendingLogs = null, string reasonForLogsStatus = null) { - return new MonitoredResourceContent( + return new MonitoredResource( id, sendingMetrics, reasonForMetricsStatus, @@ -86,86 +148,49 @@ public static MonitoredResourceContent MonitoredResourceContent(string id = null serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// Properties specific to the monitor resource. - /// Gets or sets the identity. Current supported identity types: SystemAssigned, UserAssigned. - /// A new instance for mocking. - public static DatadogMonitorResourceData DatadogMonitorResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string skuName = null, MonitorProperties properties = null, ManagedServiceIdentity identity = null) + /// Initializes a new instance of . + /// + /// A new instance for mocking. + public static DatadogSetPasswordLink DatadogSetPasswordLink(string setPasswordLink = null) { - tags ??= new Dictionary(); - - return new DatadogMonitorResourceData( - id, - name, - resourceType, - systemData, - tags, - location, - skuName != null ? new ResourceSku(skuName, serializedAdditionalRawData: null) : null, - properties, - identity, - serializedAdditionalRawData: null); + return new DatadogSetPasswordLink(setPasswordLink, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// - /// Flag specifying if the resource monitoring is enabled or disabled. - /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. - /// Datadog organization properties. - /// User info. - /// - /// The priority of the resource. - /// A new instance for mocking. - public static MonitorProperties MonitorProperties(ProvisioningState? provisioningState = null, MonitoringStatus? monitoringStatus = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, DatadogOrganizationProperties datadogOrganizationProperties = null, UserInfo userInfo = null, LiftrResourceCategory? liftrResourceCategory = null, int? liftrResourcePreference = 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 MonitorProperties( - provisioningState, - monitoringStatus, - marketplaceSubscriptionStatus, - datadogOrganizationProperties, - userInfo, - liftrResourceCategory, - liftrResourcePreference, - serializedAdditionalRawData: null); + return new BillingInfoResult(marketplaceSaasInfo, partnerBillingEntity, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the Datadog organization. - /// Id of the Datadog organization. - /// The auth code used to linking to an existing datadog organization. - /// The client_id from an existing in exchange for an auth token to link organization. - /// The redirect uri for linking. - /// Api key associated to the Datadog organization. - /// Application key associated to the Datadog organization. - /// The Id of the Enterprise App used for Single sign on. - /// A new instance for mocking. - public static DatadogOrganizationProperties DatadogOrganizationProperties(string name = null, string id = null, string linkingAuthCode = null, string linkingClientId = null, Uri redirectUri = null, string apiKey = null, string applicationKey = null, string enterpriseAppId = null) + /// Initializes a new instance of . + /// Marketplace Subscription Id. This is a GUID-formatted string. + /// Marketplace Subscription Details: SAAS Name. + /// Marketplace Subscription Details: SaaS Subscription Status. + /// The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + /// Flag specifying if the Marketplace status is subscribed or not. + /// A new instance for mocking. + public static MarketplaceSaaSInfo MarketplaceSaaSInfo(string marketplaceSubscriptionId = null, string marketplaceName = null, string marketplaceStatus = null, string billedAzureSubscriptionId = null, bool? subscribed = null) { - return new DatadogOrganizationProperties( - name, - id, - linkingAuthCode, - linkingClientId, - redirectUri, - apiKey, - applicationKey, - enterpriseAppId, + return new MarketplaceSaaSInfo( + marketplaceSubscriptionId, + marketplaceName, + marketplaceStatus, + billedAzureSubscriptionId, + subscribed, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// - /// A new instance for mocking. - public static DatadogSetPasswordLink DatadogSetPasswordLink(string setPasswordLink = null) + /// Initializes a new instance of . + /// The Datadog Organization Id. + /// The Datadog Organization Name. + /// Link to the datadog organization page. + /// A new instance for mocking. + public static PartnerBillingEntity PartnerBillingEntity(string id = null, string name = null, string partnerEntityUri = null) { - return new DatadogSetPasswordLink(setPasswordLink, serializedAdditionalRawData: null); + return new PartnerBillingEntity(id, name, partnerEntityUri, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -190,12 +215,20 @@ public static MonitoringTagRuleData MonitoringTagRuleData(ResourceIdentifier id /// /// Set of rules for sending logs for the Monitor resource. /// Set of rules for sending metrics for the Monitor resource. + /// Configuration to enable/disable auto-muting flag. + /// Configuration to enable/disable custom metrics. If enabled, custom metrics from app insights will be sent. /// A new instance for mocking. - public static MonitoringTagRulesProperties MonitoringTagRulesProperties(ProvisioningState? provisioningState = null, LogRules logRules = null, IEnumerable metricRulesFilteringTags = null) + public static MonitoringTagRulesProperties MonitoringTagRulesProperties(ProvisioningState? provisioningState = null, LogRules logRules = null, IEnumerable metricRulesFilteringTags = null, bool? automuting = null, bool? customMetrics = null) { metricRulesFilteringTags ??= new List(); - return new MonitoringTagRulesProperties(provisioningState, logRules, metricRulesFilteringTags != null ? new MetricRules(metricRulesFilteringTags?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + return new MonitoringTagRulesProperties( + provisioningState, + logRules, + metricRulesFilteringTags != null ? new MetricRules(metricRulesFilteringTags?.ToList(), serializedAdditionalRawData: null) : null, + automuting, + customMetrics, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -222,9 +255,62 @@ public static DatadogSingleSignOnResourceData DatadogSingleSignOnResourceData(Re /// The Id of the Enterprise App used for Single sign-on. /// The login URL specific to this Datadog Organization. /// A new instance for mocking. - public static DatadogSingleSignOnProperties DatadogSingleSignOnProperties(ProvisioningState? provisioningState = null, SingleSignOnState? singleSignOnState = null, string enterpriseAppId = null, Uri singleSignOnUri = null) + public static DatadogSingleSignOnProperties DatadogSingleSignOnProperties(ProvisioningState? provisioningState = null, SingleSignOnState? singleSignOnState = null, string enterpriseAppId = null, string singleSignOnUri = null) { return new DatadogSingleSignOnProperties(provisioningState, singleSignOnState, enterpriseAppId, singleSignOnUri, 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 Datadog 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 id. + /// The name. + /// The resourceType. + /// The systemData. + /// Represents the properties of the resource. + /// A new instance for mocking. + public static DatadogAgreementResource DatadogAgreementResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DatadogAgreementProperties properties = null) + { + return new DatadogAgreementResource( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the properties of the resource. + /// A new instance for mocking. + public static CreateResourceSupportedResult CreateResourceSupportedResult(CreateResourceSupportedProperties properties = null) + { + return new CreateResourceSupportedResult(properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ARM id of the subscription. + /// Indicates if selected subscription supports Datadog resource creation, if not it is already being monitored for the selected organization via multi subscription feature. + /// A new instance for mocking. + public static CreateResourceSupportedProperties CreateResourceSupportedProperties(string name = null, bool? creationSupported = null) + { + return new CreateResourceSupportedProperties(name, creationSupported, serializedAdditionalRawData: null); + } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs index 79ed533786ac..cfc8a081d642 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Autorest.CSharp.Core; @@ -16,7 +15,6 @@ using Azure.Core.Pipeline; using Azure.ResourceManager.Datadog.Models; using Azure.ResourceManager.Resources; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Datadog { @@ -38,8 +36,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _datadogMonitorResourceMonitorsClientDiagnostics; - private readonly MonitorsRestOperations _datadogMonitorResourceMonitorsRestClient; + private readonly ClientDiagnostics _datadogMonitorResourceClientDiagnostics; + private readonly DatadogMonitorResourcesRestOperations _datadogMonitorResourceRestClient; private readonly DatadogMonitorResourceData _data; /// Gets the resource type for the operations. @@ -64,9 +62,9 @@ internal DatadogMonitorResource(ArmClient client, DatadogMonitorResourceData dat /// The identifier of the resource that is the target of operations. internal DatadogMonitorResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _datadogMonitorResourceMonitorsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string datadogMonitorResourceMonitorsApiVersion); - _datadogMonitorResourceMonitorsRestClient = new MonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogMonitorResourceMonitorsApiVersion); + _datadogMonitorResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string datadogMonitorResourceApiVersion); + _datadogMonitorResourceRestClient = new DatadogMonitorResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogMonitorResourceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -109,11 +107,11 @@ public virtual MonitoringTagRuleCollection GetMonitoringTagRules() /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -140,11 +138,11 @@ public virtual async Task> GetMonitoringTagR /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -178,11 +176,11 @@ public virtual DatadogSingleSignOnResourceCollection GetDatadogSingleSignOnResou /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -209,11 +207,11 @@ public virtual async Task> GetDatadogSingl /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -231,6 +229,75 @@ public virtual Response GetDatadogSingleSignOnResou return GetDatadogSingleSignOnResources().Get(configurationName, cancellationToken); } + /// Gets a collection of MonitoredSubscriptionPropertyResources in the DatadogMonitorResource. + /// 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 Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMonitoredSubscriptionPropertyAsync(string configurationName, CancellationToken cancellationToken = default) + { + return await GetMonitoredSubscriptionProperties().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// List the subscriptions currently being monitored by the Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMonitoredSubscriptionProperty(string configurationName, CancellationToken cancellationToken = default) + { + return GetMonitoredSubscriptionProperties().Get(configurationName, cancellationToken); + } + /// /// Get the properties of a specific monitor resource. /// @@ -240,11 +307,11 @@ public virtual Response GetDatadogSingleSignOnResou /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -255,11 +322,11 @@ public virtual Response GetDatadogSingleSignOnResou /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.Get"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.Get"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogMonitorResource(Client, response.Value), response.GetRawResponse()); @@ -280,11 +347,11 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -295,11 +362,11 @@ public virtual async Task> GetAsync(Cancellatio /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.Get"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.Get"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _datadogMonitorResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogMonitorResource(Client, response.Value), response.GetRawResponse()); @@ -320,11 +387,11 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Operation Id - /// Monitors_Delete + /// DatadogMonitorResource_Delete /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -336,12 +403,12 @@ public virtual Response Get(CancellationToken cancellati /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.Delete"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.Delete"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new DatadogArmOperation(_datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, _datadogMonitorResourceMonitorsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _datadogMonitorResourceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatadogArmOperation(_datadogMonitorResourceClientDiagnostics, Pipeline, _datadogMonitorResourceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -362,11 +429,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Monitors_Delete + /// DatadogMonitorResource_Delete /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -378,12 +445,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 = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.Delete"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.Delete"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new DatadogArmOperation(_datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, _datadogMonitorResourceMonitorsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _datadogMonitorResourceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatadogArmOperation(_datadogMonitorResourceClientDiagnostics, Pipeline, _datadogMonitorResourceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -404,11 +471,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Monitors_Update + /// DatadogMonitorResource_Update /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -420,18 +487,18 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The to use. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DatadogMonitorResourcePatch patch, CancellationToken cancellationToken = default) + public virtual async Task UpdateAsync(WaitUntil waitUntil, DatadogMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.Update"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.Update"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new DatadogArmOperation(new DatadogMonitorResourceOperationSource(Client), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, _datadogMonitorResourceMonitorsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _datadogMonitorResourceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DatadogArmOperation(_datadogMonitorResourceClientDiagnostics, Pipeline, _datadogMonitorResourceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -450,11 +517,11 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Operation Id - /// Monitors_Update + /// DatadogMonitorResource_Update /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -466,18 +533,18 @@ public virtual async Task> UpdateAsync(Wait /// The to use. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DatadogMonitorResourcePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, DatadogMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.Update"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.Update"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new DatadogArmOperation(new DatadogMonitorResourceOperationSource(Client), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, _datadogMonitorResourceMonitorsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _datadogMonitorResourceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DatadogArmOperation(_datadogMonitorResourceClientDiagnostics, Pipeline, _datadogMonitorResourceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + operation.WaitForCompletionResponse(cancellationToken); return operation; } catch (Exception e) @@ -496,11 +563,11 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Operation Id - /// Monitors_ListApiKeys + /// DatadogMonitorResources_ListApiKeys /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -512,9 +579,9 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetApiKeysAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListApiKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListApiKeysNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatadogApiKey.DeserializeDatadogApiKey(e), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetApiKeys", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListApiKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListApiKeysNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatadogApiKey.DeserializeDatadogApiKey(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetApiKeys", "value", "nextLink", cancellationToken); } /// @@ -526,11 +593,11 @@ public virtual AsyncPageable GetApiKeysAsync(CancellationToken ca /// /// /// Operation Id - /// Monitors_ListApiKeys + /// DatadogMonitorResources_ListApiKeys /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -542,9 +609,9 @@ public virtual AsyncPageable GetApiKeysAsync(CancellationToken ca /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetApiKeys(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListApiKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListApiKeysNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatadogApiKey.DeserializeDatadogApiKey(e), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetApiKeys", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListApiKeysRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListApiKeysNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatadogApiKey.DeserializeDatadogApiKey(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetApiKeys", "value", "nextLink", cancellationToken); } /// @@ -556,11 +623,11 @@ public virtual Pageable GetApiKeys(CancellationToken cancellation /// /// /// Operation Id - /// Monitors_GetDefaultKey + /// DatadogMonitorResources_GetDefaultKey /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -571,11 +638,11 @@ public virtual Pageable GetApiKeys(CancellationToken cancellation /// The cancellation token to use. public virtual async Task> GetDefaultKeyAsync(CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.GetDefaultKey"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.GetDefaultKey"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.GetDefaultKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.GetDefaultKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -594,11 +661,11 @@ public virtual async Task> GetDefaultKeyAsync(Cancellati /// /// /// Operation Id - /// Monitors_GetDefaultKey + /// DatadogMonitorResources_GetDefaultKey /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -609,11 +676,11 @@ public virtual async Task> GetDefaultKeyAsync(Cancellati /// The cancellation token to use. public virtual Response GetDefaultKey(CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.GetDefaultKey"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.GetDefaultKey"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.GetDefaultKey(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _datadogMonitorResourceRestClient.GetDefaultKey(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -632,11 +699,11 @@ public virtual Response GetDefaultKey(CancellationToken cancellat /// /// /// Operation Id - /// Monitors_SetDefaultKey + /// DatadogMonitorResources_SetDefaultKey /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -648,11 +715,11 @@ public virtual Response GetDefaultKey(CancellationToken cancellat /// The cancellation token to use. public virtual async Task SetDefaultKeyAsync(DatadogApiKey body = null, CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.SetDefaultKey"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.SetDefaultKey"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.SetDefaultKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.SetDefaultKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -671,11 +738,11 @@ public virtual async Task SetDefaultKeyAsync(DatadogApiKey body = null /// /// /// Operation Id - /// Monitors_SetDefaultKey + /// DatadogMonitorResources_SetDefaultKey /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -687,11 +754,11 @@ public virtual async Task SetDefaultKeyAsync(DatadogApiKey body = null /// The cancellation token to use. public virtual Response SetDefaultKey(DatadogApiKey body = null, CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.SetDefaultKey"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.SetDefaultKey"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.SetDefaultKey(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); + var response = _datadogMonitorResourceRestClient.SetDefaultKey(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); return response; } catch (Exception e) @@ -710,11 +777,11 @@ public virtual Response SetDefaultKey(DatadogApiKey body = null, CancellationTok /// /// /// Operation Id - /// Monitors_ListHosts + /// DatadogMonitorResources_ListHosts /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -726,9 +793,9 @@ public virtual Response SetDefaultKey(DatadogApiKey body = null, CancellationTok /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetHostsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListHostsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListHostsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatadogHost.DeserializeDatadogHost(e), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetHosts", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListHostsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListHostsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatadogHost.DeserializeDatadogHost(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetHosts", "value", "nextLink", cancellationToken); } /// @@ -740,11 +807,11 @@ public virtual AsyncPageable GetHostsAsync(CancellationToken cancel /// /// /// Operation Id - /// Monitors_ListHosts + /// DatadogMonitorResources_ListHosts /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -756,9 +823,9 @@ public virtual AsyncPageable GetHostsAsync(CancellationToken cancel /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetHosts(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListHostsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListHostsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatadogHost.DeserializeDatadogHost(e), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetHosts", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListHostsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListHostsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatadogHost.DeserializeDatadogHost(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetHosts", "value", "nextLink", cancellationToken); } /// @@ -770,11 +837,11 @@ public virtual Pageable GetHosts(CancellationToken cancellationToke /// /// /// Operation Id - /// Monitors_ListLinkedResources + /// DatadogMonitorResources_ListLinkedResources /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -783,12 +850,12 @@ public virtual Pageable GetHosts(CancellationToken cancellationToke /// /// /// 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) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLinkedResourcesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListLinkedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListLinkedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetLinkedResources", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListLinkedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListLinkedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => LinkedResource.DeserializeLinkedResource(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetLinkedResources", "value", "nextLink", cancellationToken); } /// @@ -800,11 +867,11 @@ public virtual AsyncPageable GetLinkedResourcesAsync(CancellationTo /// /// /// Operation Id - /// Monitors_ListLinkedResources + /// DatadogMonitorResources_ListLinkedResources /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -813,12 +880,12 @@ public virtual AsyncPageable GetLinkedResourcesAsync(CancellationTo /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetLinkedResources(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetLinkedResources(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListLinkedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListLinkedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetLinkedResources", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListLinkedResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListLinkedResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => LinkedResource.DeserializeLinkedResource(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetLinkedResources", "value", "nextLink", cancellationToken); } /// @@ -830,11 +897,11 @@ public virtual Pageable GetLinkedResources(CancellationToken cancel /// /// /// Operation Id - /// Monitors_ListMonitoredResources + /// DatadogMonitorResources_ListMonitoredResources /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -843,12 +910,12 @@ public virtual Pageable GetLinkedResources(CancellationToken cancel /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMonitoredResourcesAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMonitoredResourcesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListMonitoredResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListMonitoredResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => MonitoredResourceContent.DeserializeMonitoredResourceContent(e), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetMonitoredResources", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListMonitoredResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListMonitoredResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => MonitoredResource.DeserializeMonitoredResource(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetMonitoredResources", "value", "nextLink", cancellationToken); } /// @@ -860,11 +927,11 @@ public virtual AsyncPageable GetMonitoredResourcesAsyn /// /// /// Operation Id - /// Monitors_ListMonitoredResources + /// DatadogMonitorResources_ListMonitoredResources /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -873,12 +940,12 @@ public virtual AsyncPageable GetMonitoredResourcesAsyn /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMonitoredResources(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMonitoredResources(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListMonitoredResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListMonitoredResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => MonitoredResourceContent.DeserializeMonitoredResourceContent(e), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResource.GetMonitoredResources", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListMonitoredResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListMonitoredResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => MonitoredResource.DeserializeMonitoredResource(e), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResource.GetMonitoredResources", "value", "nextLink", cancellationToken); } /// @@ -890,11 +957,11 @@ public virtual Pageable GetMonitoredResources(Cancella /// /// /// Operation Id - /// Monitors_RefreshSetPasswordLink + /// DatadogMonitorResources_RefreshSetPasswordLink /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -905,11 +972,11 @@ public virtual Pageable GetMonitoredResources(Cancella /// The cancellation token to use. public virtual async Task> RefreshSetPasswordLinkAsync(CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.RefreshSetPasswordLink"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.RefreshSetPasswordLink"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.RefreshSetPasswordLinkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.RefreshSetPasswordLinkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -928,11 +995,11 @@ public virtual async Task> RefreshSetPasswordLi /// /// /// Operation Id - /// Monitors_RefreshSetPasswordLink + /// DatadogMonitorResources_RefreshSetPasswordLink /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -943,11 +1010,87 @@ public virtual async Task> RefreshSetPasswordLi /// The cancellation token to use. public virtual Response RefreshSetPasswordLink(CancellationToken cancellationToken = default) { - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.RefreshSetPasswordLink"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.RefreshSetPasswordLink"); + scope.Start(); + try + { + var response = _datadogMonitorResourceRestClient.RefreshSetPasswordLink(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get marketplace and organization info mapped to the given monitor. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getBillingInfo + /// + /// + /// Operation Id + /// DatadogMonitorResources_BillingInfoGet + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> BillingInfoGetAsync(CancellationToken cancellationToken = default) + { + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.BillingInfoGet"); + scope.Start(); + try + { + var response = await _datadogMonitorResourceRestClient.BillingInfoGetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get marketplace and organization info mapped to the given monitor. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getBillingInfo + /// + /// + /// Operation Id + /// DatadogMonitorResources_BillingInfoGet + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response BillingInfoGet(CancellationToken cancellationToken = default) + { + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.BillingInfoGet"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.RefreshSetPasswordLink(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _datadogMonitorResourceRestClient.BillingInfoGet(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -966,11 +1109,11 @@ public virtual Response RefreshSetPasswordLink(Cancellat /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -987,7 +1130,7 @@ public virtual async Task> AddTagAsync(string k Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.AddTag"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.AddTag"); scope.Start(); try { @@ -996,7 +1139,7 @@ public virtual async Task> AddTagAsync(string k var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new DatadogMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1009,7 +1152,7 @@ public virtual async Task> AddTagAsync(string k } patch.Tags[key] = value; var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); + return await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } } catch (Exception e) @@ -1028,11 +1171,11 @@ public virtual async Task> AddTagAsync(string k /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -1049,7 +1192,7 @@ public virtual Response AddTag(string key, string value, Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.AddTag"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.AddTag"); scope.Start(); try { @@ -1058,7 +1201,7 @@ public virtual Response AddTag(string key, string value, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _datadogMonitorResourceMonitorsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var originalResponse = _datadogMonitorResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new DatadogMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1071,7 +1214,7 @@ public virtual Response AddTag(string key, string value, } patch.Tags[key] = value; var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); + return Get(cancellationToken: cancellationToken); } } catch (Exception e) @@ -1090,11 +1233,11 @@ public virtual Response AddTag(string key, string value, /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -1109,7 +1252,7 @@ public virtual async Task> SetTagsAsync(IDictio { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.SetTags"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.SetTags"); scope.Start(); try { @@ -1119,7 +1262,7 @@ public virtual async Task> SetTagsAsync(IDictio var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new DatadogMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1128,7 +1271,7 @@ public virtual async Task> SetTagsAsync(IDictio var patch = new DatadogMonitorResourcePatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); + return await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } } catch (Exception e) @@ -1147,11 +1290,11 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -1166,7 +1309,7 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary SetTags(IDictionary SetTags(IDictionary /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -1223,7 +1366,7 @@ public virtual async Task> RemoveTagAsync(strin { Argument.AssertNotNull(key, nameof(key)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.RemoveTag"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.RemoveTag"); scope.Start(); try { @@ -1232,7 +1375,7 @@ public virtual async Task> RemoveTagAsync(strin var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new DatadogMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1245,7 +1388,7 @@ public virtual async Task> RemoveTagAsync(strin } patch.Tags.Remove(key); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); + return await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } } catch (Exception e) @@ -1264,11 +1407,11 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -1283,7 +1426,7 @@ public virtual Response RemoveTag(string key, Cancellati { Argument.AssertNotNull(key, nameof(key)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResource.RemoveTag"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResource.RemoveTag"); scope.Start(); try { @@ -1292,7 +1435,7 @@ public virtual Response RemoveTag(string key, Cancellati var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _datadogMonitorResourceMonitorsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var originalResponse = _datadogMonitorResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new DatadogMonitorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1305,7 +1448,7 @@ public virtual Response RemoveTag(string key, Cancellati } patch.Tags.Remove(key); var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); + return Get(cancellationToken: cancellationToken); } } catch (Exception e) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceCollection.cs index 2e00fa6231c7..44fb5a0709d6 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceCollection.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceCollection.cs @@ -25,8 +25,8 @@ namespace Azure.ResourceManager.Datadog /// public partial class DatadogMonitorResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _datadogMonitorResourceMonitorsClientDiagnostics; - private readonly MonitorsRestOperations _datadogMonitorResourceMonitorsRestClient; + private readonly ClientDiagnostics _datadogMonitorResourceClientDiagnostics; + private readonly DatadogMonitorResourcesRestOperations _datadogMonitorResourceRestClient; /// Initializes a new instance of the class for mocking. protected DatadogMonitorResourceCollection() @@ -38,9 +38,9 @@ protected DatadogMonitorResourceCollection() /// The identifier of the parent resource that is the target of operations. internal DatadogMonitorResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _datadogMonitorResourceMonitorsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", DatadogMonitorResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DatadogMonitorResource.ResourceType, out string datadogMonitorResourceMonitorsApiVersion); - _datadogMonitorResourceMonitorsRestClient = new MonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogMonitorResourceMonitorsApiVersion); + _datadogMonitorResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", DatadogMonitorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DatadogMonitorResource.ResourceType, out string datadogMonitorResourceApiVersion); + _datadogMonitorResourceRestClient = new DatadogMonitorResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogMonitorResourceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Monitors_Create + /// DatadogMonitorResource_Create /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -84,12 +84,12 @@ public virtual async Task> CreateOrUpdateAs Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.CreateOrUpdate"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data, cancellationToken).ConfigureAwait(false); - var operation = new DatadogArmOperation(new DatadogMonitorResourceOperationSource(Client), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, _datadogMonitorResourceMonitorsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _datadogMonitorResourceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatadogArmOperation(new DatadogMonitorResourceOperationSource(Client), _datadogMonitorResourceClientDiagnostics, Pipeline, _datadogMonitorResourceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -110,11 +110,11 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Operation Id - /// Monitors_Create + /// DatadogMonitorResource_Create /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -133,12 +133,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.CreateOrUpdate"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data, cancellationToken); - var operation = new DatadogArmOperation(new DatadogMonitorResourceOperationSource(Client), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, _datadogMonitorResourceMonitorsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _datadogMonitorResourceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data, cancellationToken); + var operation = new DatadogArmOperation(new DatadogMonitorResourceOperationSource(Client), _datadogMonitorResourceClientDiagnostics, Pipeline, _datadogMonitorResourceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, monitorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -179,11 +179,11 @@ public virtual async Task> GetAsync(string moni { Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Get"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Get"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogMonitorResource(Client, response.Value), response.GetRawResponse()); @@ -204,11 +204,11 @@ public virtual async Task> GetAsync(string moni /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -224,11 +224,11 @@ public virtual Response Get(string monitorName, Cancella { Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Get"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Get"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken); + var response = _datadogMonitorResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogMonitorResource(Client, response.Value), response.GetRawResponse()); @@ -249,11 +249,11 @@ public virtual Response Get(string monitorName, Cancella /// /// /// Operation Id - /// Monitors_ListByResourceGroup + /// DatadogMonitorResource_ListByResourceGroup /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -265,9 +265,9 @@ public virtual Response Get(string monitorName, Cancella /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResourceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Operation Id - /// Monitors_ListByResourceGroup + /// DatadogMonitorResource_ListByResourceGroup /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -295,9 +295,9 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceMonitorsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceMonitorsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), _datadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogMonitorResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogMonitorResourceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogMonitorResourceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), _datadogMonitorResourceClientDiagnostics, Pipeline, "DatadogMonitorResourceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -309,11 +309,11 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string monitorName, Cancel { Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Exists"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Exists"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string monitorName, Cancel /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -372,11 +372,11 @@ public virtual Response Exists(string monitorName, CancellationToken cance { Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Exists"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.Exists"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken); + var response = _datadogMonitorResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -395,11 +395,11 @@ public virtual Response Exists(string monitorName, CancellationToken cance /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -415,11 +415,11 @@ public virtual async Task> GetIfExistsA { Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.GetIfExists"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.GetIfExists"); scope.Start(); try { - var response = await _datadogMonitorResourceMonitorsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _datadogMonitorResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DatadogMonitorResource(Client, response.Value), response.GetRawResponse()); @@ -440,11 +440,11 @@ public virtual async Task> GetIfExistsA /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -460,11 +460,11 @@ public virtual NullableResponse GetIfExists(string monit { Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var scope = _datadogMonitorResourceMonitorsClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.GetIfExists"); + using var scope = _datadogMonitorResourceClientDiagnostics.CreateScope("DatadogMonitorResourceCollection.GetIfExists"); scope.Start(); try { - var response = _datadogMonitorResourceMonitorsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken); + var response = _datadogMonitorResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, monitorName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DatadogMonitorResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs index 1cb677445207..d26ab37dd2ca 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs @@ -80,7 +80,7 @@ internal DatadogMonitorResourceData() /// Gets or sets the sku. internal ResourceSku Sku { get; set; } - /// Name of the SKU. + /// The name of the SKU. public string SkuName { get => Sku is null ? default : Sku.Name; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResource.cs index 249f4195b7a9..7a3f753ee847 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResource.cs @@ -33,8 +33,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics; - private readonly SingleSignOnConfigurationsRestOperations _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient; + private readonly ClientDiagnostics _datadogSingleSignOnResourceClientDiagnostics; + private readonly DatadogSingleSignOnResourcesRestOperations _datadogSingleSignOnResourceRestClient; private readonly DatadogSingleSignOnResourceData _data; /// Gets the resource type for the operations. @@ -59,9 +59,9 @@ internal DatadogSingleSignOnResource(ArmClient client, DatadogSingleSignOnResour /// The identifier of the resource that is the target of operations. internal DatadogSingleSignOnResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string datadogSingleSignOnResourceSingleSignOnConfigurationsApiVersion); - _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient = new SingleSignOnConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogSingleSignOnResourceSingleSignOnConfigurationsApiVersion); + _datadogSingleSignOnResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string datadogSingleSignOnResourceApiVersion); + _datadogSingleSignOnResourceRestClient = new DatadogSingleSignOnResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogSingleSignOnResourceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -97,11 +97,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -112,11 +112,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Get"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Get"); scope.Start(); try { - var response = await _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _datadogSingleSignOnResourceRestClient.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 DatadogSingleSignOnResource(Client, response.Value), response.GetRawResponse()); @@ -137,11 +137,11 @@ public virtual async Task> GetAsync(Cancel /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -152,11 +152,11 @@ public virtual async Task> GetAsync(Cancel /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Get"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Get"); scope.Start(); try { - var response = _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _datadogSingleSignOnResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogSingleSignOnResource(Client, response.Value), response.GetRawResponse()); @@ -177,11 +177,11 @@ public virtual Response Get(CancellationToken cance /// /// /// Operation Id - /// SingleSignOnConfigurations_CreateOrUpdate + /// DatadogSingleSignOnResource_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -197,12 +197,12 @@ public virtual async Task> UpdateAsync { Argument.AssertNotNull(data, nameof(data)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Update"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Update"); scope.Start(); try { - var response = await _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics, Pipeline, _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _datadogSingleSignOnResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceClientDiagnostics, Pipeline, _datadogSingleSignOnResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -223,11 +223,11 @@ public virtual async Task> UpdateAsync /// /// /// Operation Id - /// SingleSignOnConfigurations_CreateOrUpdate + /// DatadogSingleSignOnResource_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -243,12 +243,12 @@ public virtual ArmOperation Update(WaitUntil waitUn { Argument.AssertNotNull(data, nameof(data)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Update"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResource.Update"); scope.Start(); try { - var response = _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics, Pipeline, _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _datadogSingleSignOnResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceClientDiagnostics, Pipeline, _datadogSingleSignOnResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceCollection.cs index b070cf293b74..457a14a55b95 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceCollection.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceCollection.cs @@ -24,8 +24,8 @@ namespace Azure.ResourceManager.Datadog /// public partial class DatadogSingleSignOnResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics; - private readonly SingleSignOnConfigurationsRestOperations _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient; + private readonly ClientDiagnostics _datadogSingleSignOnResourceClientDiagnostics; + private readonly DatadogSingleSignOnResourcesRestOperations _datadogSingleSignOnResourceRestClient; /// Initializes a new instance of the class for mocking. protected DatadogSingleSignOnResourceCollection() @@ -37,9 +37,9 @@ protected DatadogSingleSignOnResourceCollection() /// The identifier of the parent resource that is the target of operations. internal DatadogSingleSignOnResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", DatadogSingleSignOnResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DatadogSingleSignOnResource.ResourceType, out string datadogSingleSignOnResourceSingleSignOnConfigurationsApiVersion); - _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient = new SingleSignOnConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogSingleSignOnResourceSingleSignOnConfigurationsApiVersion); + _datadogSingleSignOnResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Datadog", DatadogSingleSignOnResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DatadogSingleSignOnResource.ResourceType, out string datadogSingleSignOnResourceApiVersion); + _datadogSingleSignOnResourceRestClient = new DatadogSingleSignOnResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, datadogSingleSignOnResourceApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -60,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// SingleSignOnConfigurations_CreateOrUpdate + /// DatadogSingleSignOnResource_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -83,12 +83,12 @@ public virtual async Task> CreateOrUpd Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.CreateOrUpdate"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken).ConfigureAwait(false); - var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics, Pipeline, _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _datadogSingleSignOnResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceClientDiagnostics, Pipeline, _datadogSingleSignOnResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -109,11 +109,11 @@ public virtual async Task> CreateOrUpd /// /// /// Operation Id - /// SingleSignOnConfigurations_CreateOrUpdate + /// DatadogSingleSignOnResource_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -132,12 +132,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.CreateOrUpdate"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.CreateOrUpdate"); scope.Start(); try { - var response = _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken); - var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics, Pipeline, _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _datadogSingleSignOnResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data, cancellationToken); + var operation = new DatadogArmOperation(new DatadogSingleSignOnResourceOperationSource(Client), _datadogSingleSignOnResourceClientDiagnostics, Pipeline, _datadogSingleSignOnResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -158,11 +158,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -178,11 +178,11 @@ public virtual async Task> GetAsync(string { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Get"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Get"); scope.Start(); try { - var response = await _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); + var response = await _datadogSingleSignOnResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogSingleSignOnResource(Client, response.Value), response.GetRawResponse()); @@ -203,11 +203,11 @@ public virtual async Task> GetAsync(string /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -223,11 +223,11 @@ public virtual Response Get(string configurationNam { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Get"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Get"); scope.Start(); try { - var response = _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); + var response = _datadogSingleSignOnResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DatadogSingleSignOnResource(Client, response.Value), response.GetRawResponse()); @@ -248,11 +248,11 @@ public virtual Response Get(string configurationNam /// /// /// Operation Id - /// SingleSignOnConfigurations_List + /// DatadogSingleSignOnResource_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -264,9 +264,9 @@ public virtual Response Get(string configurationNam /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogSingleSignOnResource(Client, DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(e)), _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics, Pipeline, "DatadogSingleSignOnResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogSingleSignOnResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogSingleSignOnResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogSingleSignOnResource(Client, DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(e)), _datadogSingleSignOnResourceClientDiagnostics, Pipeline, "DatadogSingleSignOnResourceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -278,11 +278,11 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Operation Id - /// SingleSignOnConfigurations_List + /// DatadogSingleSignOnResource_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -294,9 +294,9 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogSingleSignOnResource(Client, DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(e)), _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics, Pipeline, "DatadogSingleSignOnResourceCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _datadogSingleSignOnResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _datadogSingleSignOnResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogSingleSignOnResource(Client, DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(e)), _datadogSingleSignOnResourceClientDiagnostics, Pipeline, "DatadogSingleSignOnResourceCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -308,11 +308,11 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -328,11 +328,11 @@ public virtual async Task> ExistsAsync(string configurationName, { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Exists"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Exists"); scope.Start(); try { - var response = await _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _datadogSingleSignOnResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -351,11 +351,11 @@ public virtual async Task> ExistsAsync(string configurationName, /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -371,11 +371,11 @@ public virtual Response Exists(string configurationName, CancellationToken { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Exists"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.Exists"); scope.Start(); try { - var response = _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + var response = _datadogSingleSignOnResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -394,11 +394,11 @@ public virtual Response Exists(string configurationName, CancellationToken /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -414,11 +414,11 @@ public virtual async Task> GetIfEx { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.GetIfExists"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.GetIfExists"); scope.Start(); try { - var response = await _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _datadogSingleSignOnResourceRestClient.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 DatadogSingleSignOnResource(Client, response.Value), response.GetRawResponse()); @@ -439,11 +439,11 @@ public virtual async Task> GetIfEx /// /// /// Operation Id - /// SingleSignOnConfigurations_Get + /// DatadogSingleSignOnResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -459,11 +459,11 @@ public virtual NullableResponse GetIfExists(string { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _datadogSingleSignOnResourceSingleSignOnConfigurationsClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.GetIfExists"); + using var scope = _datadogSingleSignOnResourceClientDiagnostics.CreateScope("DatadogSingleSignOnResourceCollection.GetIfExists"); scope.Start(); try { - var response = _datadogSingleSignOnResourceSingleSignOnConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + var response = _datadogSingleSignOnResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DatadogSingleSignOnResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceData.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceData.cs index a3e010664292..c388490d7af5 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceData.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogSingleSignOnResourceData.cs @@ -13,7 +13,10 @@ namespace Azure.ResourceManager.Datadog { - /// A class representing the DatadogSingleSignOnResource data model. + /// + /// A class representing the DatadogSingleSignOnResource data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// public partial class DatadogSingleSignOnResourceData : ResourceData { /// diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs index 3ccd2696b82a..f2c9e93433a1 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs @@ -33,6 +33,11 @@ private static MockableDatadogSubscriptionResource GetMockableDatadogSubscriptio return resource.GetCachedClient(client => new MockableDatadogSubscriptionResource(client, resource.Id)); } + private static MockableDatadogTenantResource GetMockableDatadogTenantResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatadogTenantResource(client, resource.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. @@ -90,6 +95,25 @@ public static DatadogSingleSignOnResource GetDatadogSingleSignOnResource(this Ar return GetMockableDatadogArmClient(client).GetDatadogSingleSignOnResource(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 GetMockableDatadogArmClient(client).GetMonitoredSubscriptionPropertyResource(id); + } + /// /// Gets a collection of DatadogMonitorResources in the ResourceGroupResource. /// @@ -116,11 +140,11 @@ public static DatadogMonitorResourceCollection GetDatadogMonitorResources(this R /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -154,11 +178,11 @@ public static async Task> GetDatadogMonitorReso /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -183,6 +207,78 @@ public static Response GetDatadogMonitorResource(this Re return GetMockableDatadogResourceGroupResource(resourceGroupResource).GetDatadogMonitorResource(monitorName, cancellationToken); } + /// + /// List all monitors under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// + /// + /// Operation Id + /// DatadogMonitorResource_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDatadogMonitorResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetDatadogMonitorResourcesAsync(cancellationToken); + } + + /// + /// List all monitors under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// + /// + /// Operation Id + /// DatadogMonitorResource_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDatadogMonitorResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetDatadogMonitorResources(cancellationToken); + } + /// /// List Datadog marketplace agreements in the subscription. /// @@ -192,27 +288,27 @@ public static Response GetDatadogMonitorResource(this Re /// /// /// Operation Id - /// MarketplaceAgreements_List + /// MarketplaceAgreementsOperationGroup_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetMarketplaceAgreementsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetMarketplaceAgreementsOperationGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDatadogSubscriptionResource(subscriptionResource).GetMarketplaceAgreementsAsync(cancellationToken); + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetMarketplaceAgreementsOperationGroupsAsync(cancellationToken); } /// @@ -224,27 +320,27 @@ public static AsyncPageable GetMarketplaceAg /// /// /// Operation Id - /// MarketplaceAgreements_List + /// MarketplaceAgreementsOperationGroup_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetMarketplaceAgreements(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetMarketplaceAgreementsOperationGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDatadogSubscriptionResource(subscriptionResource).GetMarketplaceAgreements(cancellationToken); + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetMarketplaceAgreementsOperationGroups(cancellationToken); } /// @@ -256,27 +352,27 @@ public static Pageable GetMarketplaceAgreeme /// /// /// Operation Id - /// MarketplaceAgreements_CreateOrUpdate + /// MarketplaceAgreementsOperationGroup_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The to use. + /// The request body. /// The cancellation token to use. - /// is null. - public static async Task> CreateOrUpdateMarketplaceAgreementAsync(this SubscriptionResource subscriptionResource, DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(this SubscriptionResource subscriptionResource, DatadogAgreementResource body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableDatadogSubscriptionResource(subscriptionResource).CreateOrUpdateMarketplaceAgreementAsync(body, cancellationToken).ConfigureAwait(false); + return await GetMockableDatadogSubscriptionResource(subscriptionResource).CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(body, cancellationToken).ConfigureAwait(false); } /// @@ -288,99 +384,221 @@ public static async Task> CreateOrU /// /// /// Operation Id - /// MarketplaceAgreements_CreateOrUpdate + /// MarketplaceAgreementsOperationGroup_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The to use. + /// The request body. /// The cancellation token to use. - /// is null. - public static Response CreateOrUpdateMarketplaceAgreement(this SubscriptionResource subscriptionResource, DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) + /// or is null. + public static Response CreateOrUpdateMarketplaceAgreementsOperationGroup(this SubscriptionResource subscriptionResource, DatadogAgreementResource body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDatadogSubscriptionResource(subscriptionResource).CreateOrUpdateMarketplaceAgreement(body, cancellationToken); + return GetMockableDatadogSubscriptionResource(subscriptionResource).CreateOrUpdateMarketplaceAgreementsOperationGroup(body, cancellationToken); } /// - /// List all monitors under the specified subscription. + /// Informs if the current subscription is being already monitored for selected Datadog organization. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses /// /// /// Operation Id - /// Monitors_List + /// CreationSupportedOperationGroup_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// + /// /// - /// Resource - /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Datadog Organization Id. + /// The cancellation token to use. + /// or is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetCreationSupportedOperationGroupsAsync(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetCreationSupportedOperationGroupsAsync(datadogOrganizationId, cancellationToken); + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses + /// + /// + /// Operation Id + /// CreationSupportedOperationGroup_List + /// + /// + /// Default Api Version + /// 2023-10-20 /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// Datadog Organization Id. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDatadogMonitorResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetCreationSupportedOperationGroups(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDatadogSubscriptionResource(subscriptionResource).GetDatadogMonitorResourcesAsync(cancellationToken); + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetCreationSupportedOperationGroups(datadogOrganizationId, cancellationToken); } /// - /// List all monitors under the specified subscription. + /// Informs if the current subscription is being already monitored for selected Datadog organization. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default /// /// /// Operation Id - /// Monitors_List + /// CreationSupportedOperationGroup_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// + /// /// - /// Resource - /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Datadog Organization Id. + /// The cancellation token to use. + /// or is null. + public static async Task> GetCreationSupportedOperationGroupAsync(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableDatadogSubscriptionResource(subscriptionResource).GetCreationSupportedOperationGroupAsync(datadogOrganizationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default + /// + /// + /// Operation Id + /// CreationSupportedOperationGroup_Get + /// + /// + /// Default Api Version + /// 2023-10-20 /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// Datadog Organization Id. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDatadogMonitorResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static Response GetCreationSupportedOperationGroup(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableDatadogSubscriptionResource(subscriptionResource).GetDatadogMonitorResources(cancellationToken); + return GetMockableDatadogSubscriptionResource(subscriptionResource).GetCreationSupportedOperationGroup(datadogOrganizationId, cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Datadog/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableDatadogTenantResource(tenantResource).GetOperationsAsync(cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Datadog/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableDatadogTenantResource(tenantResource).GetOperations(cancellationToken); } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogArmClient.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogArmClient.cs index 7246ba834fff..6ce2cd6e8ac7 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogArmClient.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogArmClient.cs @@ -69,5 +69,17 @@ public virtual DatadogSingleSignOnResource GetDatadogSingleSignOnResource(Resour DatadogSingleSignOnResource.ValidateResourceId(id); return new DatadogSingleSignOnResource(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/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogResourceGroupResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogResourceGroupResource.cs index d7f7a5ce5c05..48beaaea4b17 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogResourceGroupResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogResourceGroupResource.cs @@ -49,11 +49,11 @@ public virtual DatadogMonitorResourceCollection GetDatadogMonitorResources() /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -80,11 +80,11 @@ public virtual async Task> GetDatadogMonitorRes /// /// /// Operation Id - /// Monitors_Get + /// DatadogMonitorResource_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogSubscriptionResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogSubscriptionResource.cs index e083c6e15891..055325cd691f 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogSubscriptionResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogSubscriptionResource.cs @@ -18,10 +18,12 @@ namespace Azure.ResourceManager.Datadog.Mocking /// A class to add extension methods to SubscriptionResource. public partial class MockableDatadogSubscriptionResource : ArmResource { - private ClientDiagnostics _marketplaceAgreementsClientDiagnostics; - private MarketplaceAgreementsRestOperations _marketplaceAgreementsRestClient; - private ClientDiagnostics _datadogMonitorResourceMonitorsClientDiagnostics; - private MonitorsRestOperations _datadogMonitorResourceMonitorsRestClient; + private ClientDiagnostics _datadogMonitorResourceClientDiagnostics; + private DatadogMonitorResourcesRestOperations _datadogMonitorResourceRestClient; + private ClientDiagnostics _marketplaceAgreementsOperationGroupClientDiagnostics; + private MarketplaceAgreementsOperationGroupRestOperations _marketplaceAgreementsOperationGroupRestClient; + private ClientDiagnostics _creationSupportedOperationGroupClientDiagnostics; + private CreationSupportedOperationGroupRestOperations _creationSupportedOperationGroupRestClient; /// Initializes a new instance of the class for mocking. protected MockableDatadogSubscriptionResource() @@ -35,10 +37,12 @@ internal MockableDatadogSubscriptionResource(ArmClient client, ResourceIdentifie { } - private ClientDiagnostics MarketplaceAgreementsClientDiagnostics => _marketplaceAgreementsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private MarketplaceAgreementsRestOperations MarketplaceAgreementsRestClient => _marketplaceAgreementsRestClient ??= new MarketplaceAgreementsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics DatadogMonitorResourceMonitorsClientDiagnostics => _datadogMonitorResourceMonitorsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", DatadogMonitorResource.ResourceType.Namespace, Diagnostics); - private MonitorsRestOperations DatadogMonitorResourceMonitorsRestClient => _datadogMonitorResourceMonitorsRestClient ??= new MonitorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DatadogMonitorResource.ResourceType)); + private ClientDiagnostics DatadogMonitorResourceClientDiagnostics => _datadogMonitorResourceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", DatadogMonitorResource.ResourceType.Namespace, Diagnostics); + private DatadogMonitorResourcesRestOperations DatadogMonitorResourceRestClient => _datadogMonitorResourceRestClient ??= new DatadogMonitorResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DatadogMonitorResource.ResourceType)); + private ClientDiagnostics MarketplaceAgreementsOperationGroupClientDiagnostics => _marketplaceAgreementsOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private MarketplaceAgreementsOperationGroupRestOperations MarketplaceAgreementsOperationGroupRestClient => _marketplaceAgreementsOperationGroupRestClient ??= new MarketplaceAgreementsOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics CreationSupportedOperationGroupClientDiagnostics => _creationSupportedOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CreationSupportedOperationGroupRestOperations CreationSupportedOperationGroupRestClient => _creationSupportedOperationGroupRestClient ??= new CreationSupportedOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -46,6 +50,66 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// List all monitors under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// + /// + /// Operation Id + /// DatadogMonitorResource_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDatadogMonitorResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DatadogMonitorResourceRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DatadogMonitorResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); + } + + /// + /// List all monitors under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// + /// + /// Operation Id + /// DatadogMonitorResource_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDatadogMonitorResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DatadogMonitorResourceRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DatadogMonitorResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); + } + /// /// List Datadog marketplace agreements in the subscription. /// @@ -55,21 +119,21 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Operation Id - /// MarketplaceAgreements_List + /// MarketplaceAgreementsOperationGroup_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMarketplaceAgreementsAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMarketplaceAgreementsOperationGroupsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties(e), MarketplaceAgreementsClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsOperationGroupRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsOperationGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatadogAgreementResource.DeserializeDatadogAgreementResource(e), MarketplaceAgreementsOperationGroupClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetMarketplaceAgreementsOperationGroups", "value", "nextLink", cancellationToken); } /// @@ -81,21 +145,21 @@ public virtual AsyncPageable GetMarketplaceA /// /// /// Operation Id - /// MarketplaceAgreements_List + /// MarketplaceAgreementsOperationGroup_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMarketplaceAgreements(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMarketplaceAgreementsOperationGroups(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties(e), MarketplaceAgreementsClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsOperationGroupRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsOperationGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatadogAgreementResource.DeserializeDatadogAgreementResource(e), MarketplaceAgreementsOperationGroupClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetMarketplaceAgreementsOperationGroups", "value", "nextLink", cancellationToken); } /// @@ -107,23 +171,26 @@ public virtual Pageable GetMarketplaceAgreem /// /// /// Operation Id - /// MarketplaceAgreements_CreateOrUpdate + /// MarketplaceAgreementsOperationGroup_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// - /// The to use. + /// The request body. /// The cancellation token to use. - public virtual async Task> CreateOrUpdateMarketplaceAgreementAsync(DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> CreateOrUpdateMarketplaceAgreementsOperationGroupAsync(DatadogAgreementResource body, CancellationToken cancellationToken = default) { - using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("MockableDatadogSubscriptionResource.CreateOrUpdateMarketplaceAgreement"); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = MarketplaceAgreementsOperationGroupClientDiagnostics.CreateScope("MockableDatadogSubscriptionResource.CreateOrUpdateMarketplaceAgreementsOperationGroup"); scope.Start(); try { - var response = await MarketplaceAgreementsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, body, cancellationToken).ConfigureAwait(false); + var response = await MarketplaceAgreementsOperationGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, body, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -142,23 +209,26 @@ public virtual async Task> CreateOr /// /// /// Operation Id - /// MarketplaceAgreements_CreateOrUpdate + /// MarketplaceAgreementsOperationGroup_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// - /// The to use. + /// The request body. /// The cancellation token to use. - public virtual Response CreateOrUpdateMarketplaceAgreement(DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) + /// is null. + public virtual Response CreateOrUpdateMarketplaceAgreementsOperationGroup(DatadogAgreementResource body, CancellationToken cancellationToken = default) { - using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("MockableDatadogSubscriptionResource.CreateOrUpdateMarketplaceAgreement"); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = MarketplaceAgreementsOperationGroupClientDiagnostics.CreateScope("MockableDatadogSubscriptionResource.CreateOrUpdateMarketplaceAgreementsOperationGroup"); scope.Start(); try { - var response = MarketplaceAgreementsRestClient.CreateOrUpdate(Id.SubscriptionId, body, cancellationToken); + var response = MarketplaceAgreementsOperationGroupRestClient.CreateOrUpdate(Id.SubscriptionId, body, cancellationToken); return response; } catch (Exception e) @@ -169,63 +239,139 @@ public virtual Response CreateOrUpdateMarket } /// - /// List all monitors under the specified subscription. + /// Informs if the current subscription is being already monitored for selected Datadog organization. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses /// /// /// Operation Id - /// Monitors_List + /// CreationSupportedOperationGroup_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 + /// + /// + /// + /// Datadog Organization Id. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCreationSupportedOperationGroupsAsync(string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreationSupportedOperationGroupRestClient.CreateListRequest(Id.SubscriptionId, datadogOrganizationId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreationSupportedOperationGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, datadogOrganizationId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => CreateResourceSupportedResult.DeserializeCreateResourceSupportedResult(e), CreationSupportedOperationGroupClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetCreationSupportedOperationGroups", "value", "nextLink", cancellationToken); + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses /// /// - /// Resource - /// + /// Operation Id + /// CreationSupportedOperationGroup_List + /// + /// + /// Default Api Version + /// 2023-10-20 /// /// /// + /// Datadog Organization Id. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDatadogMonitorResourcesAsync(CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetCreationSupportedOperationGroups(string datadogOrganizationId, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DatadogMonitorResourceMonitorsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DatadogMonitorResourceMonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreationSupportedOperationGroupRestClient.CreateListRequest(Id.SubscriptionId, datadogOrganizationId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreationSupportedOperationGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, datadogOrganizationId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => CreateResourceSupportedResult.DeserializeCreateResourceSupportedResult(e), CreationSupportedOperationGroupClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetCreationSupportedOperationGroups", "value", "nextLink", cancellationToken); } /// - /// List all monitors under the specified subscription. + /// Informs if the current subscription is being already monitored for selected Datadog organization. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default /// /// /// Operation Id - /// Monitors_List + /// CreationSupportedOperationGroup_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// + /// + /// + /// Datadog Organization Id. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetCreationSupportedOperationGroupAsync(string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var scope = CreationSupportedOperationGroupClientDiagnostics.CreateScope("MockableDatadogSubscriptionResource.GetCreationSupportedOperationGroup"); + scope.Start(); + try + { + var response = await CreationSupportedOperationGroupRestClient.GetAsync(Id.SubscriptionId, datadogOrganizationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// /// - /// Resource - /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default + /// + /// + /// Operation Id + /// CreationSupportedOperationGroup_Get + /// + /// + /// Default Api Version + /// 2023-10-20 /// /// /// + /// Datadog Organization Id. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDatadogMonitorResources(CancellationToken cancellationToken = default) + /// is null. + public virtual Response GetCreationSupportedOperationGroup(string datadogOrganizationId, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DatadogMonitorResourceMonitorsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DatadogMonitorResourceMonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "MockableDatadogSubscriptionResource.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var scope = CreationSupportedOperationGroupClientDiagnostics.CreateScope("MockableDatadogSubscriptionResource.GetCreationSupportedOperationGroup"); + scope.Start(); + try + { + var response = CreationSupportedOperationGroupRestClient.Get(Id.SubscriptionId, datadogOrganizationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogTenantResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogTenantResource.cs new file mode 100644 index 000000000000..9ae9cfc67c59 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/MockableDatadogTenantResource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Datadog.Models; + +namespace Azure.ResourceManager.Datadog.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MockableDatadogTenantResource : ArmResource + { + private ClientDiagnostics _operationsClientDiagnostics; + private OperationsRestOperations _operationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDatadogTenantResource() + { + } + + /// 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 MockableDatadogTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics OperationsClientDiagnostics => _operationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationsRestOperations OperationsRestClient => _operationsRestClient ??= new OperationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Datadog/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => OperationResult.DeserializeOperationResult(e), OperationsClientDiagnostics, Pipeline, "MockableDatadogTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.Datadog/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => OperationResult.DeserializeOperationResult(e), OperationsClientDiagnostics, Pipeline, "MockableDatadogTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs new file mode 100644 index 000000000000..9df122cd6126 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog +{ + internal class MonitoredSubscriptionPropertyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MonitoredSubscriptionPropertyOperationSource(ArmClient client) + { + _client = client; + } + + MonitoredSubscriptionPropertyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDatadogContext.Default); + return new MonitoredSubscriptionPropertyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerDatadogContext.Default); + return await Task.FromResult(new MonitoredSubscriptionPropertyResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.Serialization.cs new file mode 100644 index 000000000000..ec02fa2eeb8a --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingInfoResult)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + 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, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/BillingInfoResult.cs new file mode 100644 index 000000000000..3f18bd552992 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/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.Datadog.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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.Serialization.cs new file mode 100644 index 000000000000..3624fd9665b5 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class CreateResourceSupportedProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateResourceSupportedProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(CreationSupported)) + { + writer.WritePropertyName("creationSupported"u8); + writer.WriteBooleanValue(CreationSupported.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateResourceSupportedProperties 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(CreateResourceSupportedProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateResourceSupportedProperties(document.RootElement, options); + } + + internal static CreateResourceSupportedProperties DeserializeCreateResourceSupportedProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + bool? creationSupported = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationSupported"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationSupported = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateResourceSupportedProperties(name, creationSupported, 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, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(CreateResourceSupportedProperties)} does not support writing '{options.Format}' format."); + } + } + + CreateResourceSupportedProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCreateResourceSupportedProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateResourceSupportedProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.cs new file mode 100644 index 000000000000..5fa80014a575 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.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.Datadog.Models +{ + /// Datadog resource can be created or not properties. + public partial class CreateResourceSupportedProperties + { + /// + /// 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 CreateResourceSupportedProperties() + { + } + + /// Initializes a new instance of . + /// The ARM id of the subscription. + /// Indicates if selected subscription supports Datadog resource creation, if not it is already being monitored for the selected organization via multi subscription feature. + /// Keeps track of any properties unknown to the library. + internal CreateResourceSupportedProperties(string name, bool? creationSupported, IDictionary serializedAdditionalRawData) + { + Name = name; + CreationSupported = creationSupported; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ARM id of the subscription. + public string Name { get; } + /// Indicates if selected subscription supports Datadog resource creation, if not it is already being monitored for the selected organization via multi subscription feature. + public bool? CreationSupported { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.Serialization.cs new file mode 100644 index 000000000000..91b2dbe48fdf --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + internal partial class CreateResourceSupportedResponseList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateResourceSupportedResponseList)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateResourceSupportedResponseList 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(CreateResourceSupportedResponseList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateResourceSupportedResponseList(document.RootElement, options); + } + + internal static CreateResourceSupportedResponseList DeserializeCreateResourceSupportedResponseList(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(CreateResourceSupportedResult.DeserializeCreateResourceSupportedResult(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 CreateResourceSupportedResponseList(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, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(CreateResourceSupportedResponseList)} does not support writing '{options.Format}' format."); + } + } + + CreateResourceSupportedResponseList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCreateResourceSupportedResponseList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateResourceSupportedResponseList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.cs new file mode 100644 index 000000000000..8b975a6a21e0 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// Paged collection of CreateResourceSupportedResponse items. + internal partial class CreateResourceSupportedResponseList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The CreateResourceSupportedResponse items on this page. + /// is null. + internal CreateResourceSupportedResponseList(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The CreateResourceSupportedResponse items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal CreateResourceSupportedResponseList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateResourceSupportedResponseList() + { + } + + /// The CreateResourceSupportedResponse items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.Serialization.cs new file mode 100644 index 000000000000..ab97ea5d3490 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.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.Datadog.Models +{ + public partial class CreateResourceSupportedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateResourceSupportedResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateResourceSupportedResult 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(CreateResourceSupportedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateResourceSupportedResult(document.RootElement, options); + } + + internal static CreateResourceSupportedResult DeserializeCreateResourceSupportedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CreateResourceSupportedProperties 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 = CreateResourceSupportedProperties.DeserializeCreateResourceSupportedProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateResourceSupportedResult(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, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(CreateResourceSupportedResult)} does not support writing '{options.Format}' format."); + } + } + + CreateResourceSupportedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCreateResourceSupportedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateResourceSupportedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.cs new file mode 100644 index 000000000000..6be2a46536f6 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResult.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.Datadog.Models +{ + /// Datadog resource can be created or not. + public partial class CreateResourceSupportedResult + { + /// + /// 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 CreateResourceSupportedResult() + { + } + + /// Initializes a new instance of . + /// Represents the properties of the resource. + /// Keeps track of any properties unknown to the library. + internal CreateResourceSupportedResult(CreateResourceSupportedProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the properties of the resource. + public CreateResourceSupportedProperties Properties { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceProperties.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResource.Serialization.cs similarity index 70% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceProperties.Serialization.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResource.Serialization.cs index 6b7780f68f9f..667cace2bb45 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceProperties.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResource.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Datadog.Models { - public partial class DatadogAgreementResourceProperties : IUtf8JsonSerializable, IJsonModel + public partial class DatadogAgreementResource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DatadogAgreementResourceProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DatadogAgreementResource)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -43,19 +43,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - DatadogAgreementResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DatadogAgreementResource 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(DatadogAgreementResourceProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DatadogAgreementResource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDatadogAgreementResourceProperties(document.RootElement, options); + return DeserializeDatadogAgreementResource(document.RootElement, options); } - internal static DatadogAgreementResourceProperties DeserializeDatadogAgreementResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static DatadogAgreementResource DeserializeDatadogAgreementResource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,7 +111,7 @@ internal static DatadogAgreementResourceProperties DeserializeDatadogAgreementRe } } serializedAdditionalRawData = rawDataDictionary; - return new DatadogAgreementResourceProperties( + return new DatadogAgreementResource( id, name, type, @@ -120,35 +120,35 @@ internal static DatadogAgreementResourceProperties DeserializeDatadogAgreementRe serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDatadogContext.Default); default: - throw new FormatException($"The model {nameof(DatadogAgreementResourceProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DatadogAgreementResource)} does not support writing '{options.Format}' format."); } } - DatadogAgreementResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DatadogAgreementResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDatadogAgreementResourceProperties(document.RootElement, options); + return DeserializeDatadogAgreementResource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DatadogAgreementResourceProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DatadogAgreementResource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResource.cs similarity index 81% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceProperties.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResource.cs index 7b4c8f9c6843..6d0bf6ce9c19 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResource.cs @@ -12,8 +12,8 @@ namespace Azure.ResourceManager.Datadog.Models { - /// The DatadogAgreementResourceProperties. - public partial class DatadogAgreementResourceProperties : ResourceData + /// The DatadogAgreementResource. + public partial class DatadogAgreementResource : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -47,19 +47,19 @@ public partial class DatadogAgreementResourceProperties : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DatadogAgreementResourceProperties() + /// Initializes a new instance of . + public DatadogAgreementResource() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// Represents the properties of the resource. /// Keeps track of any properties unknown to the library. - internal DatadogAgreementResourceProperties(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DatadogAgreementProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DatadogAgreementResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DatadogAgreementProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.Serialization.cs index 05cbc961adcb..2c5dfda10944 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DatadogAgreementResourceListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -86,29 +83,29 @@ internal static DatadogAgreementResourceListResponse DeserializeDatadogAgreement { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties(item, options)); + array.Add(DatadogAgreementResource.DeserializeDatadogAgreementResource(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DatadogAgreementResourceListResponse DeserializeDatadogAgreement } } serializedAdditionalRawData = rawDataDictionary; - return new DatadogAgreementResourceListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DatadogAgreementResourceListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.cs index 30f7fc575245..33119f2162ad 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogAgreementResourceListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class DatadogAgreementResourceListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DatadogAgreementResourceListResponse() + /// The DatadogAgreementResource items on this page. + /// is null. + internal DatadogAgreementResourceListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The DatadogAgreementResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DatadogAgreementResourceListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DatadogAgreementResourceListResponse(IReadOnlyList value, Uri 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; } + /// Initializes a new instance of for deserialization. + internal DatadogAgreementResourceListResponse() + { + } + + /// The DatadogAgreementResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.Serialization.cs index 0367deb65681..ccd83e8c0a44 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DatadogApiKeyListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static DatadogApiKeyListResponse DeserializeDatadogApiKeyListResponse(J return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static DatadogApiKeyListResponse DeserializeDatadogApiKeyListResponse(J } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DatadogApiKeyListResponse DeserializeDatadogApiKeyListResponse(J } } serializedAdditionalRawData = rawDataDictionary; - return new DatadogApiKeyListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DatadogApiKeyListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.cs index f4e28af97451..a066ca0ba094 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogApiKeyListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class DatadogApiKeyListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DatadogApiKeyListResponse() + /// The DatadogApiKey items on this page. + /// is null. + internal DatadogApiKeyListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The DatadogApiKey items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DatadogApiKeyListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DatadogApiKeyListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of a list operation. + /// Initializes a new instance of for deserialization. + internal DatadogApiKeyListResponse() + { + } + + /// The DatadogApiKey items on this page. public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHost.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHost.cs index 0cccb61c9801..54c08039d974 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHost.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHost.cs @@ -54,7 +54,7 @@ internal DatadogHost() /// Initializes a new instance of . /// The name of the host. - /// The aliases for the host. + /// The aliases for the host installed via the Datadog agent. /// The Datadog integrations reporting metrics for the host. /// /// Keeps track of any properties unknown to the library. @@ -69,7 +69,7 @@ internal DatadogHost(string name, IReadOnlyList aliases, IReadOnlyList The name of the host. public string Name { get; } - /// The aliases for the host. + /// The aliases for the host installed via the Datadog agent. public IReadOnlyList Aliases { get; } /// The Datadog integrations reporting metrics for the host. public IReadOnlyList Apps { get; } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.Serialization.cs index 2f74f398c31b..c25b978865d0 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DatadogHostListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static DatadogHostListResponse DeserializeDatadogHostListResponse(JsonE return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static DatadogHostListResponse DeserializeDatadogHostListResponse(JsonE } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DatadogHostListResponse DeserializeDatadogHostListResponse(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new DatadogHostListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DatadogHostListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.cs index b068a79729a9..c4de4766bf59 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHostListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class DatadogHostListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DatadogHostListResponse() + /// The DatadogHost items on this page. + /// is null. + internal DatadogHostListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The DatadogHost items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DatadogHostListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DatadogHostListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of a list operation. + /// Initializes a new instance of for deserialization. + internal DatadogHostListResponse() + { + } + + /// The DatadogHost items on this page. public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.Serialization.cs index d09a0aed512b..428baf825728 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DatadogMonitorResourceListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static DatadogMonitorResourceListResponse DeserializeDatadogMonitorReso return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static DatadogMonitorResourceListResponse DeserializeDatadogMonitorReso } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DatadogMonitorResourceListResponse DeserializeDatadogMonitorReso } } serializedAdditionalRawData = rawDataDictionary; - return new DatadogMonitorResourceListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DatadogMonitorResourceListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.cs index 853af5c64878..d25831fca794 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourceListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class DatadogMonitorResourceListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DatadogMonitorResourceListResponse() + /// The DatadogMonitorResource items on this page. + /// is null. + internal DatadogMonitorResourceListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The DatadogMonitorResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DatadogMonitorResourceListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DatadogMonitorResourceListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of a list operation. + /// Initializes a new instance of for deserialization. + internal DatadogMonitorResourceListResponse() + { + } + + /// The DatadogMonitorResource items on this page. public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs index 5a47319dd0b0..b06ab04389a3 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs @@ -65,24 +65,12 @@ internal DatadogMonitorResourcePatch(MonitorUpdateProperties properties, IDictio } /// The set of properties that can be update in a PATCH request to a monitor resource. - internal MonitorUpdateProperties Properties { get; set; } - /// Flag specifying if the resource monitoring is enabled or disabled. - public MonitoringStatus? MonitorUpdateMonitoringStatus - { - get => Properties is null ? default : Properties.MonitoringStatus; - set - { - if (Properties is null) - Properties = new MonitorUpdateProperties(); - Properties.MonitoringStatus = value; - } - } - + public MonitorUpdateProperties Properties { get; set; } /// The new tags of the monitor resource. public IDictionary Tags { get; } /// Gets or sets the sku. internal ResourceSku Sku { get; set; } - /// Name of the SKU. + /// The name of the SKU. public string SkuName { get => Sku is null ? default : Sku.Name; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.Serialization.cs index 233ae8e790cb..2cabdf41c5f5 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.Serialization.cs @@ -34,12 +34,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DatadogOrganizationProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Name)) + if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W" && Optional.IsDefined(Id)) + if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); @@ -57,7 +57,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(RedirectUri)) { writer.WritePropertyName("redirectUri"u8); - writer.WriteStringValue(RedirectUri.AbsoluteUri); + writer.WriteStringValue(RedirectUri); } if (Optional.IsDefined(ApiKey)) { @@ -74,6 +74,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enterpriseAppId"u8); writer.WriteStringValue(EnterpriseAppId); } + if (Optional.IsDefined(Cspm)) + { + writer.WritePropertyName("cspm"u8); + writer.WriteBooleanValue(Cspm.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -115,10 +120,11 @@ internal static DatadogOrganizationProperties DeserializeDatadogOrganizationProp string id = default; string linkingAuthCode = default; string linkingClientId = default; - Uri redirectUri = default; + string redirectUri = default; string apiKey = default; string applicationKey = default; string enterpriseAppId = default; + bool? cspm = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -145,11 +151,7 @@ internal static DatadogOrganizationProperties DeserializeDatadogOrganizationProp } if (property.NameEquals("redirectUri"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redirectUri = new Uri(property.Value.GetString()); + redirectUri = property.Value.GetString(); continue; } if (property.NameEquals("apiKey"u8)) @@ -167,6 +169,15 @@ internal static DatadogOrganizationProperties DeserializeDatadogOrganizationProp enterpriseAppId = property.Value.GetString(); continue; } + if (property.NameEquals("cspm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cspm = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -182,6 +193,7 @@ internal static DatadogOrganizationProperties DeserializeDatadogOrganizationProp apiKey, applicationKey, enterpriseAppId, + cspm, serializedAdditionalRawData); } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs index d40c9a0d7918..1b9ee03fd30f 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Datadog.Models { - /// Datadog organization properties. + /// Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. public partial class DatadogOrganizationProperties { /// @@ -53,14 +53,15 @@ public DatadogOrganizationProperties() /// Initializes a new instance of . /// Name of the Datadog organization. /// Id of the Datadog organization. - /// The auth code used to linking to an existing datadog organization. + /// The auth code used to linking to an existing Datadog organization. /// The client_id from an existing in exchange for an auth token to link organization. - /// The redirect uri for linking. + /// The redirect URI for linking. /// Api key associated to the Datadog organization. /// Application key associated to the Datadog organization. /// The Id of the Enterprise App used for Single sign on. + /// The configuration which describes the state of cloud security posture management. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. /// Keeps track of any properties unknown to the library. - internal DatadogOrganizationProperties(string name, string id, string linkingAuthCode, string linkingClientId, Uri redirectUri, string apiKey, string applicationKey, string enterpriseAppId, IDictionary serializedAdditionalRawData) + internal DatadogOrganizationProperties(string name, string id, string linkingAuthCode, string linkingClientId, string redirectUri, string apiKey, string applicationKey, string enterpriseAppId, bool? cspm, IDictionary serializedAdditionalRawData) { Name = name; Id = id; @@ -70,24 +71,27 @@ internal DatadogOrganizationProperties(string name, string id, string linkingAut ApiKey = apiKey; ApplicationKey = applicationKey; EnterpriseAppId = enterpriseAppId; + Cspm = cspm; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Name of the Datadog organization. - public string Name { get; } + public string Name { get; set; } /// Id of the Datadog organization. - public string Id { get; } - /// The auth code used to linking to an existing datadog organization. + public string Id { get; set; } + /// The auth code used to linking to an existing Datadog organization. public string LinkingAuthCode { get; set; } /// The client_id from an existing in exchange for an auth token to link organization. public string LinkingClientId { get; set; } - /// The redirect uri for linking. - public Uri RedirectUri { get; set; } + /// The redirect URI for linking. + public string RedirectUri { get; set; } /// Api key associated to the Datadog organization. public string ApiKey { get; set; } /// Application key associated to the Datadog organization. public string ApplicationKey { get; set; } /// The Id of the Enterprise App used for Single sign on. public string EnterpriseAppId { get; set; } + /// The configuration which describes the state of cloud security posture management. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. + public bool? Cspm { get; set; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.Serialization.cs index b95b6180edbc..0b75d93d07da 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.Serialization.cs @@ -52,7 +52,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(SingleSignOnUri)) { writer.WritePropertyName("singleSignOnUrl"u8); - writer.WriteStringValue(SingleSignOnUri.AbsoluteUri); + writer.WriteStringValue(SingleSignOnUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -94,7 +94,7 @@ internal static DatadogSingleSignOnProperties DeserializeDatadogSingleSignOnProp ProvisioningState? provisioningState = default; SingleSignOnState? singleSignOnState = default; string enterpriseAppId = default; - Uri singleSignOnUrl = default; + string singleSignOnUrl = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -124,11 +124,7 @@ internal static DatadogSingleSignOnProperties DeserializeDatadogSingleSignOnProp } if (property.NameEquals("singleSignOnUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - singleSignOnUrl = new Uri(property.Value.GetString()); + singleSignOnUrl = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs index 819bbf32ffe1..8191263d6416 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnProperties.cs @@ -56,7 +56,7 @@ public DatadogSingleSignOnProperties() /// The Id of the Enterprise App used for Single sign-on. /// The login URL specific to this Datadog Organization. /// Keeps track of any properties unknown to the library. - internal DatadogSingleSignOnProperties(ProvisioningState? provisioningState, SingleSignOnState? singleSignOnState, string enterpriseAppId, Uri singleSignOnUri, IDictionary serializedAdditionalRawData) + internal DatadogSingleSignOnProperties(ProvisioningState? provisioningState, SingleSignOnState? singleSignOnState, string enterpriseAppId, string singleSignOnUri, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; SingleSignOnState = singleSignOnState; @@ -72,6 +72,6 @@ internal DatadogSingleSignOnProperties(ProvisioningState? provisioningState, Sin /// The Id of the Enterprise App used for Single sign-on. public string EnterpriseAppId { get; set; } /// The login URL specific to this Datadog Organization. - public Uri SingleSignOnUri { get; } + public string SingleSignOnUri { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.Serialization.cs index 69bde882264a..30d862477b80 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DatadogSingleSignOnResourceListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static DatadogSingleSignOnResourceListResponse DeserializeDatadogSingle return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static DatadogSingleSignOnResourceListResponse DeserializeDatadogSingle } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static DatadogSingleSignOnResourceListResponse DeserializeDatadogSingle } } serializedAdditionalRawData = rawDataDictionary; - return new DatadogSingleSignOnResourceListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DatadogSingleSignOnResourceListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.cs index 8e3e182df560..4b3954454aa2 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogSingleSignOnResourceListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class DatadogSingleSignOnResourceListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DatadogSingleSignOnResourceListResponse() + /// The DatadogSingleSignOnResource items on this page. + /// is null. + internal DatadogSingleSignOnResourceListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The DatadogSingleSignOnResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DatadogSingleSignOnResourceListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DatadogSingleSignOnResourceListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of a list operation. + /// Initializes a new instance of for deserialization. + internal DatadogSingleSignOnResourceListResponse() + { + } + + /// The DatadogSingleSignOnResource items on this page. public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LiftrResourceCategory.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LiftrResourceCategory.cs index 789f50f2e975..5384381c930d 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LiftrResourceCategory.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LiftrResourceCategory.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Datadog.Models { - /// The LiftrResourceCategory. + /// The LiftrResourceCategories. public readonly partial struct LiftrResourceCategory : IEquatable { private readonly string _value; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.Serialization.cs new file mode 100644 index 000000000000..329fb7844a50 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class LinkedResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinkedResource)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LinkedResource 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(LinkedResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinkedResource(document.RootElement, options); + } + + internal static LinkedResource DeserializeLinkedResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string location = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinkedResource(id, 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, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(LinkedResource)} does not support writing '{options.Format}' format."); + } + } + + LinkedResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinkedResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinkedResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.cs new file mode 100644 index 000000000000..7fb41cd71166 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResource.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.Datadog.Models +{ + /// The definition of a linked resource. + public partial class LinkedResource + { + /// + /// 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 LinkedResource() + { + } + + /// Initializes a new instance of . + /// The ARM id of the linked resource. + /// The location of the linked resource. + /// Keeps track of any properties unknown to the library. + internal LinkedResource(string id, string location, IDictionary serializedAdditionalRawData) + { + Id = id; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ARM id of the linked resource. + public string Id { get; } + /// The location of the linked resource. + public string Location { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.Serialization.cs index 7e7b7db75ee6..a94b98f12cb9 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.Serialization.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Datadog.Models { @@ -35,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(LinkedResourceListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,29 +83,29 @@ internal static LinkedResourceListResponse DeserializeLinkedResourceListResponse { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); + array.Add(LinkedResource.DeserializeLinkedResource(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -118,7 +114,7 @@ internal static LinkedResourceListResponse DeserializeLinkedResourceListResponse } } serializedAdditionalRawData = rawDataDictionary; - return new LinkedResourceListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new LinkedResourceListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.cs index 4d407bebdd50..bd5ece8e9bbb 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/LinkedResourceListResponse.cs @@ -7,7 +7,7 @@ using System; using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -47,25 +47,34 @@ internal partial class LinkedResourceListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal LinkedResourceListResponse() + /// The LinkedResource items on this page. + /// is null. + internal LinkedResourceListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The LinkedResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal LinkedResourceListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LinkedResourceListResponse(IReadOnlyList value, Uri 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; } + /// Initializes a new instance of for deserialization. + internal LinkedResourceListResponse() + { + } + + /// The LinkedResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs new file mode 100644 index 000000000000..4f7ef417c6ed --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.Serialization.cs @@ -0,0 +1,183 @@ +// 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.Datadog.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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceSaaSInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + if (Optional.IsDefined(MarketplaceName)) + { + writer.WritePropertyName("marketplaceName"u8); + writer.WriteStringValue(MarketplaceName); + } + if (Optional.IsDefined(MarketplaceStatus)) + { + writer.WritePropertyName("marketplaceStatus"u8); + writer.WriteStringValue(MarketplaceStatus); + } + if (Optional.IsDefined(BilledAzureSubscriptionId)) + { + writer.WritePropertyName("billedAzureSubscriptionId"u8); + writer.WriteStringValue(BilledAzureSubscriptionId); + } + if (Optional.IsDefined(Subscribed)) + { + writer.WritePropertyName("subscribed"u8); + writer.WriteBooleanValue(Subscribed.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + 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 marketplaceName = default; + string marketplaceStatus = default; + string billedAzureSubscriptionId = default; + bool? subscribed = 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("marketplaceName"u8)) + { + marketplaceName = 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 (property.NameEquals("subscribed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscribed = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceSaaSInfo( + marketplaceSubscriptionId, + marketplaceName, + marketplaceStatus, + billedAzureSubscriptionId, + subscribed, + 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, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MarketplaceSaaSInfo.cs new file mode 100644 index 000000000000..ad032f2cafd6 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/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.Datadog.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: SaaS Subscription Status. + /// The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + /// Flag specifying if the Marketplace status is subscribed or not. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSaaSInfo(string marketplaceSubscriptionId, string marketplaceName, string marketplaceStatus, string billedAzureSubscriptionId, bool? subscribed, IDictionary serializedAdditionalRawData) + { + MarketplaceSubscriptionId = marketplaceSubscriptionId; + MarketplaceName = marketplaceName; + MarketplaceStatus = marketplaceStatus; + BilledAzureSubscriptionId = billedAzureSubscriptionId; + Subscribed = subscribed; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Marketplace Subscription Id. This is a GUID-formatted string. + public string MarketplaceSubscriptionId { get; } + /// Marketplace Subscription Details: SAAS Name. + public string MarketplaceName { 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; } + /// Flag specifying if the Marketplace status is subscribed or not. + public bool? Subscribed { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs index b603c7d912fe..34de24ab8a7e 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs @@ -54,8 +54,8 @@ public MonitorProperties() /// /// Flag specifying if the resource monitoring is enabled or disabled. /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. - /// Datadog organization properties. - /// User info. + /// Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. + /// Includes name, email and optionally, phone number. User Information can't be null. /// /// The priority of the resource. /// Keeps track of any properties unknown to the library. @@ -77,9 +77,9 @@ internal MonitorProperties(ProvisioningState? provisioningState, MonitoringStatu public MonitoringStatus? MonitoringStatus { get; set; } /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. public MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } - /// Datadog organization properties. + /// Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey is required as well. public DatadogOrganizationProperties DatadogOrganizationProperties { get; set; } - /// User info. + /// Includes name, email and optionally, phone number. User Information can't be null. public UserInfo UserInfo { get; set; } /// Gets the liftr resource category. public LiftrResourceCategory? LiftrResourceCategory { get; } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.Serialization.cs index 784d4b2790a5..93d2caae4f12 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.Datadog.Models { - internal partial class MonitorUpdateProperties : IUtf8JsonSerializable, IJsonModel + public partial class MonitorUpdateProperties : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -39,6 +39,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("monitoringStatus"u8); writer.WriteStringValue(MonitoringStatus.Value.ToString()); } + if (Optional.IsDefined(Cspm)) + { + writer.WritePropertyName("cspm"u8); + writer.WriteBooleanValue(Cspm.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +82,7 @@ internal static MonitorUpdateProperties DeserializeMonitorUpdateProperties(JsonE return null; } MonitoringStatus? monitoringStatus = default; + bool? cspm = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -90,13 +96,22 @@ internal static MonitorUpdateProperties DeserializeMonitorUpdateProperties(JsonE monitoringStatus = new MonitoringStatus(property.Value.GetString()); continue; } + if (property.NameEquals("cspm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cspm = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new MonitorUpdateProperties(monitoringStatus, serializedAdditionalRawData); + return new MonitorUpdateProperties(monitoringStatus, cspm, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.cs index 054c8335a0ba..3a1e4e1a0eee 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Datadog.Models { /// The set of properties that can be update in a PATCH request to a monitor resource. - internal partial class MonitorUpdateProperties + public partial class MonitorUpdateProperties { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,18 @@ public MonitorUpdateProperties() /// Initializes a new instance of . /// Flag specifying if the resource monitoring is enabled or disabled. + /// The new cloud security posture management value of the monitor resource. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. /// Keeps track of any properties unknown to the library. - internal MonitorUpdateProperties(MonitoringStatus? monitoringStatus, IDictionary serializedAdditionalRawData) + internal MonitorUpdateProperties(MonitoringStatus? monitoringStatus, bool? cspm, IDictionary serializedAdditionalRawData) { MonitoringStatus = monitoringStatus; + Cspm = cspm; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Flag specifying if the resource monitoring is enabled or disabled. public MonitoringStatus? MonitoringStatus { get; set; } + /// The new cloud security posture management value of the monitor resource. This collects configuration information for all resources in a subscription and track conformance to industry benchmarks. + public bool? Cspm { get; set; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceContent.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResource.Serialization.cs similarity index 76% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceContent.Serialization.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResource.Serialization.cs index 7d6e43bc3e41..238469d2869d 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceContent.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResource.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.Datadog.Models { - public partial class MonitoredResourceContent : IUtf8JsonSerializable, IJsonModel + public partial class MonitoredResource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MonitoredResourceContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MonitoredResource)} does not support writing '{format}' format."); } if (Optional.IsDefined(Id)) @@ -76,19 +76,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MonitoredResourceContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MonitoredResource 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(MonitoredResourceContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MonitoredResource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMonitoredResourceContent(document.RootElement, options); + return DeserializeMonitoredResource(document.RootElement, options); } - internal static MonitoredResourceContent DeserializeMonitoredResourceContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static MonitoredResource DeserializeMonitoredResource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -144,7 +144,7 @@ internal static MonitoredResourceContent DeserializeMonitoredResourceContent(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoredResourceContent( + return new MonitoredResource( id, sendingMetrics, reasonForMetricsStatus, @@ -153,35 +153,35 @@ internal static MonitoredResourceContent DeserializeMonitoredResourceContent(Jso serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerDatadogContext.Default); default: - throw new FormatException($"The model {nameof(MonitoredResourceContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitoredResource)} does not support writing '{options.Format}' format."); } } - MonitoredResourceContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MonitoredResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMonitoredResourceContent(document.RootElement, options); + return DeserializeMonitoredResource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MonitoredResourceContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MonitoredResource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceContent.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResource.cs similarity index 90% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceContent.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResource.cs index 98961166f7d5..e53a027e783f 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceContent.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResource.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Datadog.Models { /// The properties of a resource currently being monitored by the Datadog monitor resource. - public partial class MonitoredResourceContent + public partial class MonitoredResource { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class MonitoredResourceContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal MonitoredResourceContent() + /// Initializes a new instance of . + internal MonitoredResource() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The ARM id of the resource. /// Flag indicating if resource is sending metrics to Datadog. /// Reason for why the resource is sending metrics (or why it is not sending). /// Flag indicating if resource is sending logs to Datadog. /// Reason for why the resource is sending logs (or why it is not sending). /// Keeps track of any properties unknown to the library. - internal MonitoredResourceContent(string id, bool? sendingMetrics, string reasonForMetricsStatus, bool? sendingLogs, string reasonForLogsStatus, IDictionary serializedAdditionalRawData) + internal MonitoredResource(string id, bool? sendingMetrics, string reasonForMetricsStatus, bool? sendingLogs, string reasonForLogsStatus, IDictionary serializedAdditionalRawData) { Id = id; SendingMetrics = sendingMetrics; diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.Serialization.cs index c5b057b7f369..eccf0b0e847d 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(MonitoredResourceListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -86,29 +83,29 @@ internal static MonitoredResourceListResponse DeserializeMonitoredResourceListRe { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MonitoredResourceContent.DeserializeMonitoredResourceContent(item, options)); + array.Add(MonitoredResource.DeserializeMonitoredResource(item, options)); } value = array; continue; } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static MonitoredResourceListResponse DeserializeMonitoredResourceListRe } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoredResourceListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new MonitoredResourceListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.cs index 0f5c53205a96..e9a5d9b8a826 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredResourceListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class MonitoredResourceListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MonitoredResourceListResponse() + /// The MonitoredResource items on this page. + /// is null. + internal MonitoredResourceListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The MonitoredResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal MonitoredResourceListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal MonitoredResourceListResponse(IReadOnlyList value, Uri 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; } + /// Initializes a new instance of for deserialization. + internal MonitoredResourceListResponse() + { + } + + /// The MonitoredResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.Serialization.cs new file mode 100644 index 000000000000..434335d6ac8b --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoredSubscription)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + 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, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.cs new file mode 100644 index 000000000000..8b5ed6dcbb24 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// The list of subscriptions and it's monitoring status by current Datadog 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 . + /// The subscriptionId to be monitored. + /// is null. + public MonitoredSubscription(string subscriptionId) + { + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + + SubscriptionId = subscriptionId; + } + + /// Initializes a new instance of . + /// The subscriptionId to be monitored. + /// The state of monitoring. + /// The reason of not monitoring the subscription. + /// Definition of the properties for a TagRules 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; + } + + /// Initializes a new instance of for deserialization. + internal MonitoredSubscription() + { + } + + /// 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; } + /// Definition of the properties for a TagRules resource. + public MonitoringTagRulesProperties TagRules { get; set; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs new file mode 100644 index 000000000000..57e33575b93b --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertiesList)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + 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; + 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(MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(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 MonitoredSubscriptionPropertiesList(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, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs new file mode 100644 index 000000000000..2e8cffbbc5c9 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// Paged collection of MonitoredSubscriptionProperties items. + 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 . + /// The MonitoredSubscriptionProperties items on this page. + /// is null. + internal MonitoredSubscriptionPropertiesList(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The MonitoredSubscriptionProperties items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal MonitoredSubscriptionPropertiesList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitoredSubscriptionPropertiesList() + { + } + + /// The MonitoredSubscriptionProperties items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.Serialization.cs index e0ab8eb13872..976ac0b92145 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(MonitoringTagRulesListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static MonitoringTagRulesListResponse DeserializeMonitoringTagRulesList return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static MonitoringTagRulesListResponse DeserializeMonitoringTagRulesList } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static MonitoringTagRulesListResponse DeserializeMonitoringTagRulesList } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoringTagRulesListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new MonitoringTagRulesListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.cs index 993e4c3fb014..5f65a587b643 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Datadog.Models { @@ -46,25 +47,34 @@ internal partial class MonitoringTagRulesListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MonitoringTagRulesListResponse() + /// The MonitoringTagRules items on this page. + /// is null. + internal MonitoringTagRulesListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// The MonitoringTagRules items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal MonitoringTagRulesListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal MonitoringTagRulesListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of a list operation. + /// Initializes a new instance of for deserialization. + internal MonitoringTagRulesListResponse() + { + } + + /// The MonitoringTagRules items on this page. public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs index a27605356936..8037a0303faf 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.Serialization.cs @@ -49,6 +49,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("metricRules"u8); writer.WriteObjectValue(MetricRules, options); } + if (Optional.IsDefined(Automuting)) + { + writer.WritePropertyName("automuting"u8); + writer.WriteBooleanValue(Automuting.Value); + } + if (Optional.IsDefined(CustomMetrics)) + { + writer.WritePropertyName("customMetrics"u8); + writer.WriteBooleanValue(CustomMetrics.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -89,6 +99,8 @@ internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProper ProvisioningState? provisioningState = default; LogRules logRules = default; MetricRules metricRules = default; + bool? automuting = default; + bool? customMetrics = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -120,13 +132,37 @@ internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProper metricRules = MetricRules.DeserializeMetricRules(property.Value, options); continue; } + if (property.NameEquals("automuting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + automuting = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("customMetrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customMetrics = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new MonitoringTagRulesProperties(provisioningState, logRules, metricRules, serializedAdditionalRawData); + return new MonitoringTagRulesProperties( + provisioningState, + logRules, + metricRules, + automuting, + customMetrics, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs index 81d7c5749048..48ab31f866fd 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs @@ -54,12 +54,16 @@ public MonitoringTagRulesProperties() /// /// Set of rules for sending logs for the Monitor resource. /// Set of rules for sending metrics for the Monitor resource. + /// Configuration to enable/disable auto-muting flag. + /// Configuration to enable/disable custom metrics. If enabled, custom metrics from app insights will be sent. /// Keeps track of any properties unknown to the library. - internal MonitoringTagRulesProperties(ProvisioningState? provisioningState, LogRules logRules, MetricRules metricRules, IDictionary serializedAdditionalRawData) + internal MonitoringTagRulesProperties(ProvisioningState? provisioningState, LogRules logRules, MetricRules metricRules, bool? automuting, bool? customMetrics, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; LogRules = logRules; MetricRules = metricRules; + Automuting = automuting; + CustomMetrics = customMetrics; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -79,5 +83,10 @@ public IList MetricRulesFilteringTags return MetricRules.FilteringTags; } } + + /// Configuration to enable/disable auto-muting flag. + public bool? Automuting { get; set; } + /// Configuration to enable/disable custom metrics. If enabled, custom metrics from app insights will be sent. + public bool? CustomMetrics { get; set; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Operation.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Operation.cs new file mode 100644 index 000000000000..641e3d78b9e7 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Operation.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.Datadog.Models +{ + /// The operation for the patch on the resource. + public readonly partial struct Operation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Operation(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 Operation AddBegin { get; } = new Operation(AddBeginValue); + /// AddComplete. + public static Operation AddComplete { get; } = new Operation(AddCompleteValue); + /// DeleteBegin. + public static Operation DeleteBegin { get; } = new Operation(DeleteBeginValue); + /// DeleteComplete. + public static Operation DeleteComplete { get; } = new Operation(DeleteCompleteValue); + /// Active. + public static Operation Active { get; } = new Operation(ActiveValue); + /// Determines if two values are the same. + public static bool operator ==(Operation left, Operation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Operation left, Operation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Operation(string value) => new Operation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Operation other && Equals(other); + /// + public bool Equals(Operation 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.Serialization.cs new file mode 100644 index 000000000000..2a0fa2c3a451 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class OperationDisplay : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationDisplay)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"u8); + writer.WriteStringValue(Provider); + } + if (Optional.IsDefined(Resource)) + { + writer.WritePropertyName("resource"u8); + writer.WriteStringValue(Resource); + } + if (Optional.IsDefined(Operation)) + { + writer.WritePropertyName("operation"u8); + writer.WriteStringValue(Operation); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationDisplay IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationDisplay)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationDisplay(document.RootElement, options); + } + + internal static OperationDisplay DeserializeOperationDisplay(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string provider = default; + string resource = default; + string operation = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provider"u8)) + { + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource"u8)) + { + resource = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation"u8)) + { + operation = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(OperationDisplay)} does not support writing '{options.Format}' format."); + } + } + + OperationDisplay IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationDisplay(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationDisplay)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..963e0ec02c10 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// Represents the display information for an operation. + public partial class OperationDisplay + { + /// + /// 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 OperationDisplay() + { + } + + /// Initializes a new instance of . + /// The service provider: Microsoft.Datadog. + /// The resource on which the operation is performed. + /// The type of operation: create, update, delete, etc. + /// A localized description of the operation. + /// Keeps track of any properties unknown to the library. + internal OperationDisplay(string provider, string resource, string operation, string description, IDictionary serializedAdditionalRawData) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The service provider: Microsoft.Datadog. + public string Provider { get; } + /// The resource on which the operation is performed. + public string Resource { get; } + /// The type of operation: create, update, delete, etc. + public string Operation { get; } + /// A localized description of the operation. + public string Description { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.Serialization.cs new file mode 100644 index 000000000000..b1e59db195c2 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.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.Datadog.Models +{ + internal partial class OperationListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationListResult 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(OperationListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationListResult(document.RootElement, options); + } + + internal static OperationListResult DeserializeOperationListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OperationResult.DeserializeOperationResult(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 OperationListResult(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, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(OperationListResult)} does not support writing '{options.Format}' format."); + } + } + + OperationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.cs new file mode 100644 index 000000000000..4fd52923d4ba --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// Represents a paginated list of operation results. + internal partial class OperationListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of operations. + /// is null. + internal OperationListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of operations. + /// The URL to get the next set of results, if any. + /// Keeps track of any properties unknown to the library. + internal OperationListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperationListResult() + { + } + + /// The list of operations. + public IReadOnlyList Value { get; } + /// The URL to get the next set of results, if any. + public string NextLink { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.Serialization.cs new file mode 100644 index 000000000000..8de4fbac1542 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.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.Datadog.Models +{ + public partial class OperationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteObjectValue(Display, options); + } + if (Optional.IsDefined(IsDataAction)) + { + writer.WritePropertyName("isDataAction"u8); + writer.WriteBooleanValue(IsDataAction.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationResult 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(OperationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationResult(document.RootElement, options); + } + + internal static OperationResult DeserializeOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + OperationDisplay display = default; + bool? isDataAction = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("display"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + display = OperationDisplay.DeserializeOperationDisplay(property.Value, options); + continue; + } + if (property.NameEquals("isDataAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDataAction = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationResult(name, display, isDataAction, 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, AzureResourceManagerDatadogContext.Default); + default: + throw new FormatException($"The model {nameof(OperationResult)} does not support writing '{options.Format}' format."); + } + } + + OperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.cs new file mode 100644 index 000000000000..ef0e05f73cff --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/OperationResult.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.Datadog.Models +{ + /// A Microsoft.Datadog REST API operation. + public partial class OperationResult + { + /// + /// 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 OperationResult() + { + } + + /// Initializes a new instance of . + /// Operation name, i.e., {provider}/{resource}/{operation}. + /// The object that represents the operation. + /// Indicates whether the operation is a data action. + /// Keeps track of any properties unknown to the library. + internal OperationResult(string name, OperationDisplay display, bool? isDataAction, IDictionary serializedAdditionalRawData) + { + Name = name; + Display = display; + IsDataAction = isDataAction; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Operation name, i.e., {provider}/{resource}/{operation}. + public string Name { get; } + /// The object that represents the operation. + public OperationDisplay Display { get; } + /// Indicates whether the operation is a data action. + public bool? IsDataAction { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.Serialization.cs new file mode 100644 index 000000000000..ee849b56e6cb --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PartnerBillingEntity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(PartnerEntityUri)) + { + writer.WritePropertyName("partnerEntityUri"u8); + writer.WriteStringValue(PartnerEntityUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + 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 id = default; + string name = default; + string partnerEntityUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("partnerEntityUri"u8)) + { + partnerEntityUri = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PartnerBillingEntity(id, name, partnerEntityUri, 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, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.cs new file mode 100644 index 000000000000..67d8e0e5432a --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/PartnerBillingEntity.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.Datadog.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 Datadog Organization Id. + /// The Datadog Organization Name. + /// Link to the datadog organization page. + /// Keeps track of any properties unknown to the library. + internal PartnerBillingEntity(string id, string name, string partnerEntityUri, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + PartnerEntityUri = partnerEntityUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Datadog Organization Id. + public string Id { get; } + /// The Datadog Organization Name. + public string Name { get; } + /// Link to the datadog organization page. + public string PartnerEntityUri { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/ResourceSku.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/ResourceSku.cs index 90e7a9f06b17..4b10f83ae5b2 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/ResourceSku.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/ResourceSku.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Datadog.Models { - /// The ResourceSku. + /// Represents the SKU of a resource. internal partial class ResourceSku { /// @@ -46,7 +46,7 @@ internal partial class ResourceSku private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the SKU. + /// The name of the SKU. /// is null. public ResourceSku(string name) { @@ -56,7 +56,7 @@ public ResourceSku(string name) } /// Initializes a new instance of . - /// Name of the SKU. + /// The name of the SKU. /// Keeps track of any properties unknown to the library. internal ResourceSku(string name, IDictionary serializedAdditionalRawData) { @@ -69,7 +69,7 @@ internal ResourceSku() { } - /// Name of the SKU. + /// The name of the SKU. public string Name { get; set; } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Status.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..1c40c67ad38d --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/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.Datadog.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 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.Serialization.cs new file mode 100644 index 000000000000..ddf39f28327a --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.Serialization.cs @@ -0,0 +1,158 @@ +// 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.Datadog.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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriptionList)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Operation)) + { + writer.WritePropertyName("operation"u8); + writer.WriteStringValue(Operation.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" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + 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; + } + Operation? operation = default; + IList monitoredSubscriptionList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operation = new Operation(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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubscriptionList(operation, monitoredSubscriptionList ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.cs new file mode 100644 index 000000000000..ffb0687fac96 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.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.Datadog.Models +{ + /// The request to update subscriptions needed to be monitored by the Datadog 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. + /// Keeps track of any properties unknown to the library. + internal SubscriptionList(Operation? operation, IList monitoredSubscriptionList, IDictionary serializedAdditionalRawData) + { + Operation = operation; + MonitoredSubscriptionList = monitoredSubscriptionList; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The operation for the patch on the resource. + public Operation? Operation { get; set; } + /// List of subscriptions and the state of the monitoring. + public IList MonitoredSubscriptionList { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/UserInfo.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/UserInfo.cs index 7132b36b2fda..0df4c5a76aaa 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/UserInfo.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/UserInfo.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Datadog.Models { - /// User info. + /// Includes name, email and optionally, phone number. User Information can't be null. public partial class UserInfo { /// diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyCollection.cs new file mode 100644 index 000000000000..e52e090f4ed7 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Datadog +{ + /// + /// 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.Datadog", 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 != DatadogMonitorResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DatadogMonitorResource.ResourceType), nameof(id)); + } + + /// + /// Add the subscriptions that should be monitored by the Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_CreateorUpdate + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task CreateOrUpdateAsync(WaitUntil waitUntil, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + 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 DatadogArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateorUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add the subscriptions that should be monitored by the Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_CreateorUpdate + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + 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 DatadogArmOperation(_monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateorUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the subscriptions currently being monitored by the Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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 Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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 Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_List + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// Resource + /// + /// + /// + /// + /// The configuration name. Only 'default' value is supported. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs new file mode 100644 index 000000000000..d1e867543afa --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Datadog.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Datadog +{ + public partial class MonitoredSubscriptionPropertyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoredSubscriptionPropertyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + 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, AzureResourceManagerDatadogContext.Default); + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.cs new file mode 100644 index 000000000000..4adef9a407c3 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/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.Datadog.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Datadog +{ + /// + /// A class representing the MonitoredSubscriptionProperty data model. + /// The request to update subscriptions needed to be monitored by the Datadog 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 Datadog 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 Datadog monitor resource. + public SubscriptionList Properties { get; set; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.Serialization.cs new file mode 100644 index 000000000000..564186b661d0 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/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.Datadog +{ + 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, AzureResourceManagerDatadogContext.Default); + + MonitoredSubscriptionPropertyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerDatadogContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs new file mode 100644 index 000000000000..7a20dd848278 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Datadog +{ + /// + /// 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, string configurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/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 = "Microsoft.Datadog/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.Datadog", 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 Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Get + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 Datadog monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Delete + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 DatadogArmOperation(_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 Datadog monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Delete + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 DatadogArmOperation(_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 Datadog monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Update + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 DatadogArmOperation(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 Datadog monitor resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptionProperties_Update + /// + /// + /// Default Api Version + /// 2023-10-20 + /// + /// + /// 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 DatadogArmOperation(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/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleCollection.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleCollection.cs index 8f7017c0cc50..a2c346ae02a7 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleCollection.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleCollection.cs @@ -60,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// TagRules_CreateOrUpdate + /// MonitoringTagRules_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -111,11 +111,11 @@ public virtual async Task> CreateOrUpdat /// /// /// Operation Id - /// TagRules_CreateOrUpdate + /// MonitoringTagRules_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -162,11 +162,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -207,11 +207,11 @@ public virtual async Task> GetAsync(string r /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -252,11 +252,11 @@ public virtual Response Get(string ruleSetName, Cance /// /// /// Operation Id - /// TagRules_List + /// MonitoringTagRules_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -282,11 +282,11 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Operation Id - /// TagRules_List + /// MonitoringTagRules_List /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -312,11 +312,11 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -355,11 +355,11 @@ public virtual async Task> ExistsAsync(string ruleSetName, Cancel /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -398,11 +398,11 @@ public virtual Response Exists(string ruleSetName, CancellationToken cance /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -443,11 +443,11 @@ public virtual async Task> GetIfExis /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleResource.cs index fc8b4759e2ef..88b8324097d5 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoringTagRuleResource.cs @@ -97,11 +97,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -137,11 +137,11 @@ public virtual async Task> GetAsync(Cancella /// /// /// Operation Id - /// TagRules_Get + /// MonitoringTagRules_Get /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -177,11 +177,11 @@ public virtual Response Get(CancellationToken cancell /// /// /// Operation Id - /// TagRules_CreateOrUpdate + /// MonitoringTagRules_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource @@ -225,11 +225,11 @@ public virtual async Task> UpdateAsync(W /// /// /// Operation Id - /// TagRules_CreateOrUpdate + /// MonitoringTagRules_CreateOrUpdate /// /// /// Default Api Version - /// 2021-03-01 + /// 2023-10-20 /// /// /// Resource diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedOperationGroupRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedOperationGroupRestOperations.cs new file mode 100644 index 000000000000..c271449d66fd --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedOperationGroupRestOperations.cs @@ -0,0 +1,287 @@ +// 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.Datadog.Models; + +namespace Azure.ResourceManager.Datadog +{ + internal partial class CreationSupportedOperationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CreationSupportedOperationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public CreationSupportedOperationGroupRestOperations(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 ?? "2023-10-20"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string datadogOrganizationId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Datadog/subscriptionStatuses", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("datadogOrganizationId", datadogOrganizationId, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string datadogOrganizationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Datadog/subscriptionStatuses", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("datadogOrganizationId", datadogOrganizationId, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// The ID of the target subscription. The value must be an UUID. + /// Datadog Organization Id. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var message = CreateListRequest(subscriptionId, datadogOrganizationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CreateResourceSupportedResponseList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CreateResourceSupportedResponseList.DeserializeCreateResourceSupportedResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// The ID of the target subscription. The value must be an UUID. + /// Datadog Organization Id. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var message = CreateListRequest(subscriptionId, datadogOrganizationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CreateResourceSupportedResponseList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CreateResourceSupportedResponseList.DeserializeCreateResourceSupportedResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string datadogOrganizationId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Datadog/subscriptionStatuses/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("datadogOrganizationId", datadogOrganizationId, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string datadogOrganizationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Datadog/subscriptionStatuses/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("datadogOrganizationId", datadogOrganizationId, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// The ID of the target subscription. The value must be an UUID. + /// Datadog Organization Id. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var message = CreateGetRequest(subscriptionId, datadogOrganizationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CreateResourceSupportedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CreateResourceSupportedResult.DeserializeCreateResourceSupportedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// The ID of the target subscription. The value must be an UUID. + /// Datadog Organization Id. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var message = CreateGetRequest(subscriptionId, datadogOrganizationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CreateResourceSupportedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CreateResourceSupportedResult.DeserializeCreateResourceSupportedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string datadogOrganizationId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string datadogOrganizationId) + { + 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; + } + + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Datadog Organization Id. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, datadogOrganizationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CreateResourceSupportedResponseList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CreateResourceSupportedResponseList.DeserializeCreateResourceSupportedResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Datadog Organization Id. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, datadogOrganizationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CreateResourceSupportedResponseList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CreateResourceSupportedResponseList.DeserializeCreateResourceSupportedResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/DatadogMonitorResourcesRestOperations.cs similarity index 92% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/DatadogMonitorResourcesRestOperations.cs index 4812d4549679..d3733765bf55 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/DatadogMonitorResourcesRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.Datadog { - internal partial class MonitorsRestOperations + internal partial class DatadogMonitorResourcesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of MonitorsRestOperations. + /// Initializes a new instance of DatadogMonitorResourcesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public MonitorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public DatadogMonitorResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-10-20"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListApiKeysRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,16 +46,15 @@ internal RequestUriBuilder CreateListApiKeysRequestUri(string subscriptionId, st uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/listApiKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListApiKeysRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -64,7 +63,6 @@ internal HttpMessage CreateListApiKeysRequest(string subscriptionId, string reso uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/listApiKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,65 +70,69 @@ internal HttpMessage CreateListApiKeysRequest(string subscriptionId, string reso return message; } - /// List the api keys for a given monitor resource. - /// The ID of the target subscription. + /// Get the properties of a specific monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListApiKeysAsync(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)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListApiKeysRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogApiKeyListResponse value = default; + DatadogMonitorResourceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); + value = DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((DatadogMonitorResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List the api keys for a given monitor resource. - /// The ID of the target subscription. + /// Get the properties of a specific monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListApiKeys(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)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListApiKeysRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogApiKeyListResponse value = default; + DatadogMonitorResourceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); + value = DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((DatadogMonitorResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetDefaultKeyRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -140,16 +142,15 @@ internal RequestUriBuilder CreateGetDefaultKeyRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/getDefaultKey", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetDefaultKeyRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -158,73 +159,72 @@ internal HttpMessage CreateGetDefaultKeyRequest(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/getDefaultKey", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Get the default api key. - /// The ID of the target subscription. + /// Create a monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// The to use. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetDefaultKeyAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData 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 = CreateGetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, monitorName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DatadogApiKey value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogApiKey.DeserializeDatadogApiKey(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get the default api key. - /// The ID of the target subscription. + /// Create a monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// The to use. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response GetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData 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 = CreateGetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, monitorName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DatadogApiKey value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogApiKey.DeserializeDatadogApiKey(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSetDefaultKeyRequestUri(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -234,16 +234,15 @@ internal RequestUriBuilder CreateSetDefaultKeyRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/setDefaultKey", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSetDefaultKeyRequest(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -252,72 +251,72 @@ internal HttpMessage CreateSetDefaultKeyRequest(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/setDefaultKey", 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.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); - request.Content = content; - } + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Set the default api key. - /// The ID of the target subscription. + /// Update a monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// The to use. + /// The to use. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task SetDefaultKeyAsync(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body = null, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateSetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName, body); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Set the default api key. - /// The ID of the target subscription. + /// Update a monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// The to use. + /// The to use. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response SetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body = null, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateSetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName, body); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListHostsRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -327,16 +326,15 @@ internal RequestUriBuilder CreateListHostsRequestUri(string subscriptionId, stri uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/listHosts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListHostsRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -345,7 +343,6 @@ internal HttpMessage CreateListHostsRequest(string subscriptionId, string resour uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/listHosts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -353,65 +350,59 @@ internal HttpMessage CreateListHostsRequest(string subscriptionId, string resour return message; } - /// List the hosts for a given monitor resource. - /// The ID of the target subscription. + /// Delete a monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListHostsAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(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 = CreateListHostsRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DatadogHostListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List the hosts for a given monitor resource. - /// The ID of the target subscription. + /// Delete a monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListHosts(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response Delete(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 = CreateListHostsRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DatadogHostListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListLinkedResourcesRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -419,27 +410,23 @@ internal RequestUriBuilder CreateListLinkedResourcesRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); - uri.AppendPath(monitorName, true); - uri.AppendPath("/listLinkedResources", false); + uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListLinkedResourcesRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); - uri.AppendPath(monitorName, true); - uri.AppendPath("/listLinkedResources", false); + uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -447,28 +434,26 @@ internal HttpMessage CreateListLinkedResourcesRequest(string subscriptionId, str return message; } - /// List all Azure resources associated to the same Datadog organization as the target resource. - /// The ID of the target subscription. + /// List all monitors under the specified resource group. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Monitor resource name. /// 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) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListLinkedResourcesRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - LinkedResourceListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -476,28 +461,26 @@ public async Task> ListLinkedResourcesAsync } } - /// List all Azure resources associated to the same Datadog organization as the target resource. - /// The ID of the target subscription. + /// List all monitors under the specified resource group. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Monitor resource name. /// 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) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListLinkedResourcesRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - LinkedResourceListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -505,35 +488,27 @@ public Response ListLinkedResources(string subscript } } - internal RequestUriBuilder CreateListMonitoredResourcesRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); - uri.AppendPath(monitorName, true); - uri.AppendPath("/listMonitoredResources", false); + uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListMonitoredResourcesRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateListRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); - uri.AppendPath(monitorName, true); - uri.AppendPath("/listMonitoredResources", false); + uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -541,28 +516,24 @@ internal HttpMessage CreateListMonitoredResourcesRequest(string subscriptionId, return message; } - /// List the resources currently being monitored by the Datadog monitor resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name. + /// List all monitors under the specified subscription. + /// The ID of the target subscription. The value must be an UUID. /// 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) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListMonitoredResourcesRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateListRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MonitoredResourceListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -570,28 +541,24 @@ public async Task> ListMonitoredResource } } - /// List the resources currently being monitored by the Datadog monitor resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name. + /// List all monitors under the specified subscription. + /// The ID of the target subscription. The value must be an UUID. /// 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) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListMonitoredResourcesRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateListRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MonitoredResourceListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -599,27 +566,35 @@ public Response ListMonitoredResources(string sub } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListApiKeysRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listApiKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId) + internal HttpMessage CreateListApiKeysRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listApiKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -627,24 +602,28 @@ internal HttpMessage CreateListRequest(string subscriptionId) return message; } - /// List all monitors under the specified subscription. - /// The ID of the target subscription. + /// List the api keys for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListApiKeysAsync(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); + using var message = CreateListApiKeysRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + DatadogApiKeyListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -652,24 +631,28 @@ public async Task> ListAsync(string } } - /// List all monitors under the specified subscription. - /// The ID of the target subscription. + /// List the api keys for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListApiKeys(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); + using var message = CreateListApiKeysRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + DatadogApiKeyListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -677,7 +660,7 @@ public Response List(string subscriptionId, } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateGetDefaultKeyRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -685,23 +668,27 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); + uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/getDefaultKey", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateGetDefaultKeyRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Datadog/monitors", false); + uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/getDefaultKey", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -709,26 +696,28 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// List all monitors under the specified resource group. - /// The ID of the target subscription. + /// Get the default api key. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetDefaultKeyAsync(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 = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateGetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + DatadogApiKey value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = DatadogApiKey.DeserializeDatadogApiKey(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -736,26 +725,28 @@ public async Task> ListByResourceGr } } - /// List all monitors under the specified resource group. - /// The ID of the target subscription. + /// Get the default api key. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetDefaultKey(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 = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateGetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + DatadogApiKey value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = DatadogApiKey.DeserializeDatadogApiKey(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -763,7 +754,7 @@ public Response ListByResourceGroup(string s } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateSetDefaultKeyRequestUri(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -773,15 +764,16 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/setDefaultKey", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateSetDefaultKeyRequest(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -790,76 +782,166 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/setDefaultKey", 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.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } _userAgent.Apply(message); return message; } - /// Get the properties of a specific monitor resource. - /// The ID of the target subscription. + /// Set the default api key. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// 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> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task SetDefaultKeyAsync(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body = null, 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); + using var message = CreateSetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Set the default api key. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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 SetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, DatadogApiKey body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + + using var message = CreateSetDefaultKeyRequest(subscriptionId, resourceGroupName, monitorName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListHostsRequestUri(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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listHosts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListHostsRequest(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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/listHosts", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the hosts for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListHostsAsync(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 = CreateListHostsRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceData value = default; + DatadogHostListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(document.RootElement); + value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DatadogMonitorResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get the properties of a specific monitor resource. - /// The ID of the target subscription. + /// List the hosts for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response ListHosts(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); + using var message = CreateListHostsRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceData value = default; + DatadogHostListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(document.RootElement); + value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DatadogMonitorResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData data) + internal RequestUriBuilder CreateListLinkedResourcesRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -869,15 +951,16 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/listLinkedResources", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData data) + internal HttpMessage CreateListLinkedResourcesRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -886,72 +969,73 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/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"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create a monitor resource. - /// The ID of the target subscription. + /// List all Azure resources associated to the same Datadog organization as the target resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// The to use. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData data, CancellationToken cancellationToken = default) + 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)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, monitorName, data); + using var message = CreateListLinkedResourcesRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + LinkedResourceListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create a monitor resource. - /// The ID of the target subscription. + /// List all Azure resources associated to the same Datadog organization as the target resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// The to use. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourceData data, CancellationToken cancellationToken = default) + 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)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, monitorName, data); + using var message = CreateListLinkedResourcesRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + LinkedResourceListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch) + internal RequestUriBuilder CreateListMonitoredResourcesRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -961,15 +1045,16 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/listMonitoredResources", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch) + internal HttpMessage CreateListMonitoredResourcesRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -978,72 +1063,73 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/listMonitoredResources", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update a monitor resource. - /// The ID of the target subscription. + /// List the resources currently being monitored by the Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// The to use. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch, 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)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, patch); + using var message = CreateListMonitoredResourcesRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + MonitoredResourceListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Update a monitor resource. - /// The ID of the target subscription. + /// List the resources currently being monitored by the Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// The to use. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string monitorName, DatadogMonitorResourcePatch patch, 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)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, monitorName, patch); + using var message = CreateListMonitoredResourcesRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + MonitoredResourceListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateRefreshSetPasswordLinkRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1053,15 +1139,16 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/refreshSetPasswordLink", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateRefreshSetPasswordLinkRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1070,6 +1157,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); + uri.AppendPath("/refreshSetPasswordLink", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1077,59 +1165,65 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete a monitor resource. - /// The ID of the target subscription. + /// Refresh the set password link and return a latest one. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task> RefreshSetPasswordLinkAsync(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 = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateRefreshSetPasswordLinkRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DatadogSetPasswordLink value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DatadogSetPasswordLink.DeserializeDatadogSetPasswordLink(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete a monitor resource. - /// The ID of the target subscription. + /// Refresh the set password link and return a latest one. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response RefreshSetPasswordLink(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 = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateRefreshSetPasswordLinkRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + DatadogSetPasswordLink value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DatadogSetPasswordLink.DeserializeDatadogSetPasswordLink(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateRefreshSetPasswordLinkRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateBillingInfoGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1139,12 +1233,12 @@ internal RequestUriBuilder CreateRefreshSetPasswordLinkRequestUri(string subscri uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/refreshSetPasswordLink", false); + uri.AppendPath("/getBillingInfo", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateRefreshSetPasswordLinkRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateBillingInfoGetRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1157,7 +1251,7 @@ internal HttpMessage CreateRefreshSetPasswordLinkRequest(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/refreshSetPasswordLink", false); + uri.AppendPath("/getBillingInfo", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1165,28 +1259,28 @@ internal HttpMessage CreateRefreshSetPasswordLinkRequest(string subscriptionId, return message; } - /// Refresh the set password link and return a latest one. - /// The ID of the target subscription. + /// Get marketplace and organization info mapped to the given monitor. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> RefreshSetPasswordLinkAsync(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public async Task> BillingInfoGetAsync(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 = CreateRefreshSetPasswordLinkRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateBillingInfoGetRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogSetPasswordLink value = default; + BillingInfoResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogSetPasswordLink.DeserializeDatadogSetPasswordLink(document.RootElement); + value = BillingInfoResult.DeserializeBillingInfoResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1194,28 +1288,28 @@ public async Task> RefreshSetPasswordLinkAsync( } } - /// Refresh the set password link and return a latest one. - /// The ID of the target subscription. + /// Get marketplace and organization info mapped to the given monitor. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response RefreshSetPasswordLink(string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + public Response BillingInfoGet(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 = CreateRefreshSetPasswordLinkRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateBillingInfoGetRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogSetPasswordLink value = default; + BillingInfoResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogSetPasswordLink.DeserializeDatadogSetPasswordLink(document.RootElement); + value = BillingInfoResult.DeserializeBillingInfoResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1223,7 +1317,7 @@ public Response RefreshSetPasswordLink(string subscripti } } - internal RequestUriBuilder CreateListApiKeysNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1231,7 +1325,7 @@ internal RequestUriBuilder CreateListApiKeysNextPageRequestUri(string nextLink, return uri; } - internal HttpMessage CreateListApiKeysNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1245,30 +1339,28 @@ internal HttpMessage CreateListApiKeysNextPageRequest(string nextLink, string su return message; } - /// List the api keys for a given monitor resource. + /// List all monitors under the specified resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Monitor resource name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListApiKeysNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListApiKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogApiKeyListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1276,30 +1368,28 @@ public async Task> ListApiKeysNextPageAsync( } } - /// List the api keys for a given monitor resource. + /// List all monitors under the specified resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Monitor resource name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListApiKeysNextPage(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListApiKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogApiKeyListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1307,7 +1397,7 @@ public Response ListApiKeysNextPage(string nextLink, } } - internal RequestUriBuilder CreateListHostsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1315,7 +1405,7 @@ internal RequestUriBuilder CreateListHostsNextPageRequestUri(string nextLink, st return uri; } - internal HttpMessage CreateListHostsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1329,30 +1419,26 @@ internal HttpMessage CreateListHostsNextPageRequest(string nextLink, string subs return message; } - /// List the hosts for a given monitor resource. + /// List all monitors under the specified subscription. /// 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. - /// Monitor resource name. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListHostsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListHostsNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + using var message = CreateListNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogHostListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1360,30 +1446,26 @@ public async Task> ListHostsNextPageAsync(stri } } - /// List the hosts for a given monitor resource. + /// List all monitors under the specified subscription. /// 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. - /// Monitor resource name. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListHostsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListHostsNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + using var message = CreateListNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogHostListResponse value = default; + DatadogMonitorResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); + value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1391,7 +1473,7 @@ public Response ListHostsNextPage(string nextLink, stri } } - internal RequestUriBuilder CreateListLinkedResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateListApiKeysNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1399,7 +1481,7 @@ internal RequestUriBuilder CreateListLinkedResourcesNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListLinkedResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateListApiKeysNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1413,30 +1495,30 @@ internal HttpMessage CreateListLinkedResourcesNextPageRequest(string nextLink, s return message; } - /// List all Azure resources associated to the same Datadog organization as the target resource. + /// List the api keys for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// 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) + public async Task> ListApiKeysNextPageAsync(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); + using var message = CreateListApiKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - LinkedResourceListResponse value = default; + DatadogApiKeyListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1444,30 +1526,30 @@ public async Task> ListLinkedResourcesNextP } } - /// List all Azure resources associated to the same Datadog organization as the target resource. + /// List the api keys for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// 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) + public Response ListApiKeysNextPage(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); + using var message = CreateListApiKeysNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - LinkedResourceListResponse value = default; + DatadogApiKeyListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); + value = DatadogApiKeyListResponse.DeserializeDatadogApiKeyListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1475,7 +1557,7 @@ public Response ListLinkedResourcesNextPage(string n } } - internal RequestUriBuilder CreateListMonitoredResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateListHostsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1483,7 +1565,7 @@ internal RequestUriBuilder CreateListMonitoredResourcesNextPageRequestUri(string return uri; } - internal HttpMessage CreateListMonitoredResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateListHostsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1497,30 +1579,30 @@ internal HttpMessage CreateListMonitoredResourcesNextPageRequest(string nextLink return message; } - /// List the resources currently being monitored by the Datadog monitor resource. + /// List the hosts for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// 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> ListHostsNextPageAsync(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 = CreateListMonitoredResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + using var message = CreateListHostsNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MonitoredResourceListResponse value = default; + DatadogHostListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); + value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1528,30 +1610,30 @@ public async Task> ListMonitoredResource } } - /// List the resources currently being monitored by the Datadog monitor resource. + /// List the hosts for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// 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 ListHostsNextPage(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 = CreateListMonitoredResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); + using var message = CreateListHostsNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MonitoredResourceListResponse value = default; + DatadogHostListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); + value = DatadogHostListResponse.DeserializeDatadogHostListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1559,7 +1641,7 @@ public Response ListMonitoredResourcesNextPage(st } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListLinkedResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1567,7 +1649,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListLinkedResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1581,26 +1663,30 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// List all monitors under the specified subscription. + /// List all Azure resources associated to the same Datadog organization as the target resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , , 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 = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListLinkedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + LinkedResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1608,26 +1694,30 @@ public async Task> ListNextPageAsyn } } - /// List all monitors under the specified subscription. + /// List all Azure resources associated to the same Datadog organization as the target resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , , 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 = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListLinkedResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + LinkedResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = LinkedResourceListResponse.DeserializeLinkedResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1635,7 +1725,7 @@ public Response ListNextPage(string nextLink } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListMonitoredResourcesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1643,7 +1733,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListMonitoredResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1657,28 +1747,30 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List all monitors under the specified resource group. + /// List the resources currently being monitored by the Datadog monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , 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) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListMonitoredResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + MonitoredResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1686,28 +1778,30 @@ public async Task> ListByResourceGr } } - /// List all monitors under the specified resource group. + /// List the resources currently being monitored by the Datadog monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , 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) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListMonitoredResourcesNextPageRequest(nextLink, subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogMonitorResourceListResponse value = default; + MonitoredResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogMonitorResourceListResponse.DeserializeDatadogMonitorResourceListResponse(document.RootElement); + value = MonitoredResourceListResponse.DeserializeMonitoredResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/DatadogSingleSignOnResourcesRestOperations.cs similarity index 96% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/DatadogSingleSignOnResourcesRestOperations.cs index 420fc2201a64..a9145c7ebaa3 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/DatadogSingleSignOnResourcesRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.Datadog { - internal partial class SingleSignOnConfigurationsRestOperations + internal partial class DatadogSingleSignOnResourcesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of SingleSignOnConfigurationsRestOperations. + /// Initializes a new instance of DatadogSingleSignOnResourcesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public SingleSignOnConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public DatadogSingleSignOnResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-10-20"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,12 +46,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/singleSignOnConfigurations", false); + uri.AppendPath("/singleSignOnConfigurations/", false); + uri.AppendPath(configurationName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,7 +65,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/singleSignOnConfigurations", false); + uri.AppendPath("/singleSignOnConfigurations/", false); + uri.AppendPath(configurationName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,59 +74,67 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// List the single sign-on configurations for a given monitor resource. - /// The ID of the target subscription. + /// Gets the datadog single sign-on resource for the given Monitor. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// Configuration name. /// 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) + /// , , 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, string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogSingleSignOnResourceListResponse value = default; + DatadogSingleSignOnResourceData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogSingleSignOnResourceListResponse.DeserializeDatadogSingleSignOnResourceListResponse(document.RootElement); + value = DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((DatadogSingleSignOnResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List the single sign-on configurations for a given monitor resource. - /// The ID of the target subscription. + /// Gets the datadog single sign-on resource for the given Monitor. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// Configuration name. /// 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) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogSingleSignOnResourceListResponse value = default; + DatadogSingleSignOnResourceData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogSingleSignOnResourceListResponse.DeserializeDatadogSingleSignOnResourceListResponse(document.RootElement); + value = DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((DatadogSingleSignOnResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -173,7 +183,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Configures single-sign-on for this resource. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// Configuration name. @@ -202,7 +212,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Configures single-sign-on for this resource. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// Configuration name. @@ -230,7 +240,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -240,13 +250,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/singleSignOnConfigurations/", false); - uri.AppendPath(configurationName, true); + uri.AppendPath("/singleSignOnConfigurations", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, string configurationName) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -259,8 +268,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/singleSignOnConfigurations/", false); - uri.AppendPath(configurationName, true); + uri.AppendPath("/singleSignOnConfigurations", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -268,67 +276,59 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets the datadog single sign-on resource for the given Monitor. - /// The ID of the target subscription. + /// List the single sign-on configurations for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// Configuration name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) + /// , 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)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DatadogSingleSignOnResourceData value = default; + DatadogSingleSignOnResourceListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(document.RootElement); + value = DatadogSingleSignOnResourceListResponse.DeserializeDatadogSingleSignOnResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DatadogSingleSignOnResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the datadog single sign-on resource for the given Monitor. - /// The ID of the target subscription. + /// List the single sign-on configurations for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// Configuration name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, CancellationToken cancellationToken = default) + /// , 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)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DatadogSingleSignOnResourceData value = default; + DatadogSingleSignOnResourceListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogSingleSignOnResourceData.DeserializeDatadogSingleSignOnResourceData(document.RootElement); + value = DatadogSingleSignOnResourceListResponse.DeserializeDatadogSingleSignOnResourceListResponse(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DatadogSingleSignOnResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -358,7 +358,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List the single sign-on configurations for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. @@ -389,7 +389,7 @@ public async Task> ListNextPag /// List the single sign-on configurations for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsOperationGroupRestOperations.cs similarity index 85% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsRestOperations.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsOperationGroupRestOperations.cs index 6cccd0d1de2f..abc7a8344fd4 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsOperationGroupRestOperations.cs @@ -15,24 +15,24 @@ namespace Azure.ResourceManager.Datadog { - internal partial class MarketplaceAgreementsRestOperations + internal partial class MarketplaceAgreementsOperationGroupRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of MarketplaceAgreementsRestOperations. + /// Initializes a new instance of MarketplaceAgreementsOperationGroupRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public MarketplaceAgreementsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public MarketplaceAgreementsOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-10-20"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// List Datadog marketplace agreements in the subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListAsync(stri } /// List Datadog marketplace agreements in the subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -114,7 +114,7 @@ public Response List(string subscriptionId } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, DatadogAgreementResourceProperties body) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, DatadogAgreementResource body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -125,7 +125,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, DatadogAgreementResourceProperties body) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, DatadogAgreementResource body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -138,26 +138,24 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, DatadogA 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.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); - request.Content = content; - } + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } /// Create Datadog marketplace agreement in the subscription. - /// The ID of the target subscription. - /// The to use. + /// The ID of the target subscription. The value must be an UUID. + /// The request body. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string subscriptionId, DatadogAgreementResource body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); using var message = CreateCreateOrUpdateRequest(subscriptionId, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -165,9 +163,9 @@ public async Task> CreateOrUpdateAs { case 200: { - DatadogAgreementResourceProperties value = default; + DatadogAgreementResource value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties(document.RootElement); + value = DatadogAgreementResource.DeserializeDatadogAgreementResource(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -176,14 +174,15 @@ public async Task> CreateOrUpdateAs } /// Create Datadog marketplace agreement in the subscription. - /// The ID of the target subscription. - /// The to use. + /// The ID of the target subscription. The value must be an UUID. + /// The request body. /// The cancellation token to use. - /// is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, DatadogAgreementResource body, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); using var message = CreateCreateOrUpdateRequest(subscriptionId, body); _pipeline.Send(message, cancellationToken); @@ -191,9 +190,9 @@ public Response CreateOrUpdate(string subscr { case 200: { - DatadogAgreementResourceProperties value = default; + DatadogAgreementResource value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties(document.RootElement); + value = DatadogAgreementResource.DeserializeDatadogAgreementResource(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -225,7 +224,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List Datadog marketplace agreements in the subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -252,7 +251,7 @@ public async Task> ListNextPageAs /// List Datadog marketplace agreements in the subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs new file mode 100644 index 000000000000..b7bf2068ea6d --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs @@ -0,0 +1,617 @@ +// 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.Datadog.Models; + +namespace Azure.ResourceManager.Datadog +{ + 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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2023-10-20"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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, ModelSerializationExtensions.JsonDocumentOptions, 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + 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, ModelSerializationExtensions.JsonDocumentOptions); + 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, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateorUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + 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: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add the subscriptions that should be monitored by the Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + 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: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string monitorName, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, MonitoredSubscriptionPropertyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + 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, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string monitorName, string 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/Microsoft.Datadog/monitors/", false); + uri.AppendPath(monitorName, true); + uri.AppendPath("/monitoredSubscriptions/", false); + uri.AppendPath(configurationName, 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the subscriptions that are being monitored by the Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, monitorName, configurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder 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/Microsoft.Datadog/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/Microsoft.Datadog/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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, ModelSerializationExtensions.JsonDocumentOptions, 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 Datadog monitor resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, ModelSerializationExtensions.JsonDocumentOptions); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(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) + { + 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 Datadog monitor resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, ModelSerializationExtensions.JsonDocumentOptions, 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 Datadog monitor resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// 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, ModelSerializationExtensions.JsonDocumentOptions); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/OperationsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/OperationsRestOperations.cs new file mode 100644 index 000000000000..c64f58768011 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/OperationsRestOperations.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Datadog.Models; + +namespace Azure.ResourceManager.Datadog +{ + internal partial class OperationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public OperationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-10-20"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri() + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.Datadog/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.Datadog/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the operations for the provider. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the operations for the provider. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the operations for the provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the operations for the provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/TagRulesRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/TagRulesRestOperations.cs index 8b2da67f4990..53e9e38023ca 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/TagRulesRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/TagRulesRestOperations.cs @@ -25,18 +25,18 @@ internal partial class TagRulesRestOperations /// Initializes a new instance of TagRulesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public TagRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-10-20"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,12 +46,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/tagRules", false); + uri.AppendPath("/tagRules/", false); + uri.AppendPath(ruleSetName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,7 +65,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/tagRules", false); + uri.AppendPath("/tagRules/", false); + uri.AppendPath(ruleSetName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,59 +74,67 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// List the tag rules for a given monitor resource. - /// The ID of the target subscription. + /// Get a tag rule set for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// Rule set name. /// 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) + /// , , 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, string ruleSetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(ruleSetName, nameof(ruleSetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, ruleSetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MonitoringTagRulesListResponse value = default; + MonitoringTagRuleData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = MonitoringTagRulesListResponse.DeserializeMonitoringTagRulesListResponse(document.RootElement); + value = MonitoringTagRuleData.DeserializeMonitoringTagRuleData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((MonitoringTagRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List the tag rules for a given monitor resource. - /// The ID of the target subscription. + /// Get a tag rule set for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. + /// Rule set name. /// 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) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(monitorName, nameof(monitorName)); + Argument.AssertNotNullOrEmpty(ruleSetName, nameof(ruleSetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, ruleSetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MonitoringTagRulesListResponse value = default; + MonitoringTagRuleData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = MonitoringTagRulesListResponse.DeserializeMonitoringTagRulesListResponse(document.RootElement); + value = MonitoringTagRuleData.DeserializeMonitoringTagRuleData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((MonitoringTagRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -173,7 +183,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a tag rule set for a given monitor resource. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// Rule set name. @@ -206,7 +216,7 @@ public async Task> CreateOrUpdateAsync(string su } /// Create or update a tag rule set for a given monitor resource. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// Rule set name. @@ -238,7 +248,7 @@ public Response CreateOrUpdate(string subscriptionId, str } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string monitorName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -248,13 +258,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/tagRules/", false); - uri.AppendPath(ruleSetName, true); + uri.AppendPath("/tagRules", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string monitorName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -267,8 +276,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Datadog/monitors/", false); uri.AppendPath(monitorName, true); - uri.AppendPath("/tagRules/", false); - uri.AppendPath(ruleSetName, true); + uri.AppendPath("/tagRules", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -276,67 +284,59 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get a tag rule set for a given monitor resource. - /// The ID of the target subscription. + /// List the tag rules for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// Rule set name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, CancellationToken cancellationToken = default) + /// , 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)); - Argument.AssertNotNullOrEmpty(ruleSetName, nameof(ruleSetName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, ruleSetName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MonitoringTagRuleData value = default; + MonitoringTagRulesListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = MonitoringTagRuleData.DeserializeMonitoringTagRuleData(document.RootElement); + value = MonitoringTagRulesListResponse.DeserializeMonitoringTagRulesListResponse(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((MonitoringTagRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a tag rule set for a given monitor resource. - /// The ID of the target subscription. + /// List the tag rules for a given monitor resource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. - /// Rule set name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, CancellationToken cancellationToken = default) + /// , 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)); - Argument.AssertNotNullOrEmpty(ruleSetName, nameof(ruleSetName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, monitorName, ruleSetName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, monitorName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MonitoringTagRuleData value = default; + MonitoringTagRulesListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = MonitoringTagRuleData.DeserializeMonitoringTagRuleData(document.RootElement); + value = MonitoringTagRulesListResponse.DeserializeMonitoringTagRulesListResponse(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((MonitoringTagRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -366,7 +366,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List the tag rules for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. @@ -397,7 +397,7 @@ public async Task> ListNextPageAsync(st /// List the tag rules for a given monitor resource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Monitor resource name. /// The cancellation token to use. diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md b/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md deleted file mode 100644 index ea66a000cbb4..000000000000 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md +++ /dev/null @@ -1,56 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml - -azure-arm: true -csharp: true -library-name: Datadog -namespace: Azure.ResourceManager.Datadog -require: https://github.com/Azure/azure-rest-api-specs/blob/066eb8c81e14e0f3b22b6700c67693eef5f79ea9/specification/datadog/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../tests/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -rename-mapping: - DatadogAgreementResource: DatadogAgreementResourceProperties - MonitoredResource: MonitoredResourceContent - -``` diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs deleted file mode 100644 index 3059f7e202b5..000000000000 --- a/sdk/datadog/Azure.ResourceManager.Datadog/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ /dev/null @@ -1,102 +0,0 @@ -// 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.Datadog.Models; -using Azure.ResourceManager.Resources; -using NUnit.Framework; - -namespace Azure.ResourceManager.Datadog.Samples -{ - public partial class Sample_SubscriptionResourceExtensions - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetMarketplaceAgreements_MarketplaceAgreementsList() - { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_List.json - // this example is just showing the usage of "MarketplaceAgreements_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "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 (DatadogAgreementResourceProperties item in subscriptionResource.GetMarketplaceAgreementsAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdateMarketplaceAgreement_MarketplaceAgreementsCreateOrUpdate() - { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_Create.json - // this example is just showing the usage of "MarketplaceAgreements_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 SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation - DatadogAgreementResourceProperties result = await subscriptionResource.CreateOrUpdateMarketplaceAgreementAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetDatadogMonitorResources_MonitorsList() - { - // Generated from example definition: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_List.json - // this example is just showing the usage of "Monitors_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "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 (DatadogMonitorResource item in subscriptionResource.GetDatadogMonitorResourcesAsync()) - { - // 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 - DatadogMonitorResourceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - } -} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/tsp-location.yaml b/sdk/datadog/Azure.ResourceManager.Datadog/tsp-location.yaml new file mode 100644 index 000000000000..4618d722ef88 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/datadog/Datadog.Management +commit: 2ff3228b987ab59dff3d5df9a3192ed7c5567e3e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/