From 984a969c6eeff668363c7c0e88b50779620a4586 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 31 Aug 2023 10:04:29 +0000 Subject: [PATCH] CodeGen from PR 24495 in Azure/azure-rest-api-specs Merge e85049f2b3a6d4ca49dd756bf68a0c8cb2df91d8 into 95c0363e4cae8756c6a33b58add67776db427bbc --- ....ResourceManager.Datadog.netstandard2.0.cs | 128 ++++- .../src/Generated/ArmDatadogModelFactory.cs | 55 ++- .../src/Generated/DatadogMonitorResource.cs | 53 ++ .../Generated/DatadogMonitorResourceData.cs | 2 +- .../Generated/Extensions/DatadogExtensions.cs | 117 +++++ .../SubscriptionResourceExtensionClient.cs | 110 +++++ ...oredSubscriptionPropertyOperationSource.cs | 40 ++ ...sourceSupportedProperties.Serialization.cs | 43 ++ .../CreateResourceSupportedProperties.cs | 32 ++ ...ResourceSupportedResponse.Serialization.cs | 37 ++ .../Models/CreateResourceSupportedResponse.cs | 28 ++ ...urceSupportedResponseList.Serialization.cs | 43 ++ .../CreateResourceSupportedResponseList.cs | 32 ++ .../src/Generated/Models/DatadogHost.cs | 4 +- .../Models/DatadogMonitorResourcePatch.cs | 16 +- ...dogOrganizationProperties.Serialization.cs | 27 +- .../Models/DatadogOrganizationProperties.cs | 20 +- .../src/Generated/Models/MonitorProperties.cs | 8 +- .../MonitorUpdateProperties.Serialization.cs | 7 +- .../Models/MonitorUpdateProperties.cs | 4 +- .../MonitoredSubscription.Serialization.cs | 85 ++++ .../Generated/Models/MonitoredSubscription.cs | 40 ++ ...ubscriptionPropertiesList.Serialization.cs | 44 ++ .../MonitoredSubscriptionPropertiesList.cs | 33 ++ ...dSubscriptionPropertyData.Serialization.cs | 78 +++ ...itoringTagRulesProperties.Serialization.cs | 17 +- .../Models/MonitoringTagRulesProperties.cs | 7 +- .../src/Generated/Models/Operation.cs | 60 +++ .../src/Generated/Models/ResourceSku.cs | 4 +- .../src/Generated/Models/Status.cs | 57 +++ .../Models/SubscriptionList.Serialization.cs | 74 +++ .../src/Generated/Models/SubscriptionList.cs | 36 ++ .../src/Generated/Models/UserInfo.cs | 2 +- ...MonitoredSubscriptionPropertyCollection.cs | 339 +++++++++++++ .../MonitoredSubscriptionPropertyData.cs | 39 ++ .../MonitoredSubscriptionPropertyResource.cs | 297 ++++++++++++ .../CreationSupportedRestOperations.cs | 184 +++++++ .../MarketplaceAgreementsRestOperations.cs | 2 +- .../MonitoredSubscriptionsRestOperations.cs | 455 ++++++++++++++++++ .../RestOperations/MonitorsRestOperations.cs | 2 +- ...ingleSignOnConfigurationsRestOperations.cs | 2 +- .../RestOperations/TagRulesRestOperations.cs | 2 +- .../src/autorest.md | 2 +- 43 files changed, 2600 insertions(+), 67 deletions(-) create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.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/CreateResourceSupportedResponse.Serialization.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponse.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/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/MonitoredSubscriptionPropertyData.Serialization.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/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.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedRestOperations.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs 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 75df9246790b4..7b8ab53e2d13b 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 @@ -4,6 +4,10 @@ public static partial class DatadogExtensions { public static Azure.Response CreateOrUpdateMarketplaceAgreement(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.Datadog.Models.DatadogAgreementResource 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.DatadogAgreementResource body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetCreationSupported(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCreationSupportedAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetCreationSupporteds(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string datadogOrganizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetCreationSupportedsAsync(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; } @@ -13,6 +17,7 @@ public static partial class DatadogExtensions 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.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 partial class DatadogMonitorResource : Azure.ResourceManager.ArmResource @@ -41,6 +46,9 @@ protected DatadogMonitorResource() { } 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; } @@ -109,6 +117,40 @@ public partial class DatadogSingleSignOnResourceData : Azure.ResourceManager.Mod public DatadogSingleSignOnResourceData() { } public Azure.ResourceManager.Datadog.Models.DatadogSingleSignOnProperties Properties { get { throw null; } set { } } } + 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; } + 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 + { + public MonitoredSubscriptionPropertyData() { } + public Azure.ResourceManager.Datadog.Models.SubscriptionList Properties { get { throw null; } set { } } + } + public partial class MonitoredSubscriptionPropertyResource : Azure.ResourceManager.ArmResource + { + 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; } + 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() { } @@ -146,20 +188,33 @@ namespace Azure.ResourceManager.Datadog.Models { public static partial class ArmDatadogModelFactory { + public static Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties CreateResourceSupportedProperties(string name = null, bool? creationSupported = default(bool?)) { throw null; } + public static Azure.ResourceManager.Datadog.Models.CreateResourceSupportedResponse CreateResourceSupportedResponse(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.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.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?)) { 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 partial class CreateResourceSupportedProperties + { + internal CreateResourceSupportedProperties() { } + public bool? CreationSupported { get { throw null; } } + public string Name { get { throw null; } } + } + public partial class CreateResourceSupportedResponse + { + internal CreateResourceSupportedResponse() { } + public Azure.ResourceManager.Datadog.Models.CreateResourceSupportedProperties Properties { get { throw null; } } + } public partial class DatadogAgreementProperties { public DatadogAgreementProperties() { } @@ -210,7 +265,7 @@ internal DatadogInstallMethod() { } public partial class DatadogMonitorResourcePatch { 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; } } } @@ -219,11 +274,12 @@ public partial class DatadogOrganizationProperties 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 string Name { get { throw null; } set { } } public System.Uri RedirectUri { get { throw null; } set { } } } public partial class DatadogSetPasswordLink @@ -301,6 +357,14 @@ internal MonitoredResource() { } public bool? SendingLogs { get { throw null; } } public bool? SendingMetrics { get { throw null; } } } + public partial class MonitoredSubscription + { + public MonitoredSubscription() { } + 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 { } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MonitoringStatus : System.IEquatable { @@ -322,6 +386,7 @@ internal MonitoredResource() { } public partial class MonitoringTagRulesProperties { public MonitoringTagRulesProperties() { } + public bool? Automuting { 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; } } @@ -337,6 +402,33 @@ public MonitorProperties() { } public Azure.ResourceManager.Datadog.Models.ProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Datadog.Models.UserInfo UserInfo { get { throw null; } set { } } } + public partial class MonitorUpdateProperties + { + public MonitorUpdateProperties() { } + public bool? Cspm { get { throw null; } set { } } + public Azure.ResourceManager.Datadog.Models.MonitoringStatus? MonitoringStatus { get { throw null; } set { } } + } + [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; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ProvisioningState : System.IEquatable { @@ -383,6 +475,32 @@ public MonitorProperties() { } 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 + { + public SubscriptionList() { } + public System.Collections.Generic.IList MonitoredSubscriptionList { get { throw null; } } + public Azure.ResourceManager.Datadog.Models.Operation? Operation { get { throw null; } set { } } + } + [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/src/Generated/ArmDatadogModelFactory.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs index 7d6f6e7eeded7..3e251b96b6a58 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/ArmDatadogModelFactory.cs @@ -29,9 +29,26 @@ public static DatadogAgreementResource DatadogAgreementResource(ResourceIdentifi return new DatadogAgreementResource(id, name, resourceType, systemData, properties); } + /// Initializes a new instance of CreateResourceSupportedResponse. + /// Represents the properties of the resource. + /// A new instance for mocking. + public static CreateResourceSupportedResponse CreateResourceSupportedResponse(CreateResourceSupportedProperties properties = null) + { + return new CreateResourceSupportedResponse(properties); + } + + /// Initializes a new instance of CreateResourceSupportedProperties. + /// 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); + } + /// Initializes a new instance of DatadogHost. /// 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. @@ -97,8 +114,8 @@ public static DatadogMonitorResourceData DatadogMonitorResourceData(ResourceIden /// /// 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. /// A new instance for mocking. @@ -107,21 +124,6 @@ public static MonitorProperties MonitorProperties(ProvisioningState? provisionin return new MonitorProperties(provisioningState, monitoringStatus, marketplaceSubscriptionStatus, datadogOrganizationProperties, userInfo, liftrResourceCategory, liftrResourcePreference); } - /// Initializes a new instance of DatadogOrganizationProperties. - /// 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) - { - return new DatadogOrganizationProperties(name, id, linkingAuthCode, linkingClientId, redirectUri, apiKey, applicationKey, enterpriseAppId); - } - /// Initializes a new instance of DatadogSetPasswordLink. /// /// A new instance for mocking. @@ -146,12 +148,13 @@ 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. /// 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) { metricRulesFilteringTags ??= new List(); - return new MonitoringTagRulesProperties(provisioningState, logRules, metricRulesFilteringTags != null ? new MetricRules(metricRulesFilteringTags?.ToList()) : null); + return new MonitoringTagRulesProperties(provisioningState, logRules, metricRulesFilteringTags != null ? new MetricRules(metricRulesFilteringTags?.ToList()) : null, automuting); } /// Initializes a new instance of DatadogSingleSignOnResourceData. @@ -176,5 +179,17 @@ public static DatadogSingleSignOnProperties DatadogSingleSignOnProperties(Provis { return new DatadogSingleSignOnProperties(provisioningState, singleSignOnState, enterpriseAppId, singleSignOnUri); } + + /// Initializes a new instance of MonitoredSubscriptionPropertyData. + /// 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); + } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs index 06449ceca8388..c0c609f823298 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs @@ -198,6 +198,59 @@ 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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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. + [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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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. + [ForwardsClientCalls] + public virtual Response GetMonitoredSubscriptionProperty(string configurationName, CancellationToken cancellationToken = default) + { + return GetMonitoredSubscriptionProperties().Get(configurationName, cancellationToken); + } + /// /// Get the properties of a specific monitor resource. /// diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs index 980adb9585ce8..11615c63cc869 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResourceData.cs @@ -40,7 +40,7 @@ internal DatadogMonitorResourceData(ResourceIdentifier id, string name, Resource /// Gets or sets the sku. internal ResourceSku Sku { get; set; } - /// Name of the SKU. + /// Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. public string SkuName { get => Sku is null ? default : Sku.Name; 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 3a98cbdf67f44..346e7426dfc8d 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs @@ -107,6 +107,25 @@ public static DatadogSingleSignOnResource GetDatadogSingleSignOnResource(this Ar } #endregion + #region MonitoredSubscriptionPropertyResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static MonitoredSubscriptionPropertyResource GetMonitoredSubscriptionPropertyResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + MonitoredSubscriptionPropertyResource.ValidateResourceId(id); + return new MonitoredSubscriptionPropertyResource(client, id); + } + ); + } + #endregion + /// Gets a collection of DatadogMonitorResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of DatadogMonitorResources and their operations over a DatadogMonitorResource. @@ -247,6 +266,104 @@ public static Response CreateOrUpdateMarketplaceAgreem return GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateMarketplaceAgreement(body, cancellationToken); } + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses + /// + /// + /// Operation Id + /// CreationSupported_List + /// + /// + /// + /// 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 GetCreationSupportedsAsync(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCreationSupportedsAsync(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 + /// CreationSupported_List + /// + /// + /// + /// 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 GetCreationSupporteds(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCreationSupporteds(datadogOrganizationId, cancellationToken); + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default + /// + /// + /// Operation Id + /// CreationSupported_Get + /// + /// + /// + /// The instance the method will execute against. + /// Datadog Organization Id. + /// The cancellation token to use. + /// is null. + public static async Task> GetCreationSupportedAsync(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetCreationSupportedAsync(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 + /// CreationSupported_Get + /// + /// + /// + /// The instance the method will execute against. + /// Datadog Organization Id. + /// The cancellation token to use. + /// is null. + public static Response GetCreationSupported(this SubscriptionResource subscriptionResource, string datadogOrganizationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(datadogOrganizationId, nameof(datadogOrganizationId)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCreationSupported(datadogOrganizationId, cancellationToken); + } + /// /// List all monitors under the specified subscription. /// diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 831c7d77da773..05005db70a511 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -22,6 +22,8 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource { private ClientDiagnostics _marketplaceAgreementsClientDiagnostics; private MarketplaceAgreementsRestOperations _marketplaceAgreementsRestClient; + private ClientDiagnostics _creationSupportedClientDiagnostics; + private CreationSupportedRestOperations _creationSupportedRestClient; private ClientDiagnostics _datadogMonitorResourceMonitorsClientDiagnostics; private MonitorsRestOperations _datadogMonitorResourceMonitorsRestClient; @@ -39,6 +41,8 @@ internal SubscriptionResourceExtensionClient(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 CreationSupportedClientDiagnostics => _creationSupportedClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Datadog", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CreationSupportedRestOperations CreationSupportedRestClient => _creationSupportedRestClient ??= new CreationSupportedRestOperations(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)); @@ -154,6 +158,112 @@ public virtual Response CreateOrUpdateMarketplaceAgree } } + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses + /// + /// + /// Operation Id + /// CreationSupported_List + /// + /// + /// + /// Datadog Organization Id. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCreationSupportedsAsync(string datadogOrganizationId, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreationSupportedRestClient.CreateListRequest(Id.SubscriptionId, datadogOrganizationId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CreateResourceSupportedResponse.DeserializeCreateResourceSupportedResponse, CreationSupportedClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCreationSupporteds", "value", null, cancellationToken); + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses + /// + /// + /// Operation Id + /// CreationSupported_List + /// + /// + /// + /// Datadog Organization Id. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetCreationSupporteds(string datadogOrganizationId, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreationSupportedRestClient.CreateListRequest(Id.SubscriptionId, datadogOrganizationId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CreateResourceSupportedResponse.DeserializeCreateResourceSupportedResponse, CreationSupportedClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCreationSupporteds", "value", null, cancellationToken); + } + + /// + /// Informs if the current subscription is being already monitored for selected Datadog organization. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default + /// + /// + /// Operation Id + /// CreationSupported_Get + /// + /// + /// + /// Datadog Organization Id. + /// The cancellation token to use. + public virtual async Task> GetCreationSupportedAsync(string datadogOrganizationId, CancellationToken cancellationToken = default) + { + using var scope = CreationSupportedClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCreationSupported"); + scope.Start(); + try + { + var response = await CreationSupportedRestClient.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. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default + /// + /// + /// Operation Id + /// CreationSupported_Get + /// + /// + /// + /// Datadog Organization Id. + /// The cancellation token to use. + public virtual Response GetCreationSupported(string datadogOrganizationId, CancellationToken cancellationToken = default) + { + using var scope = CreationSupportedClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCreationSupported"); + scope.Start(); + try + { + var response = CreationSupportedRestClient.Get(Id.SubscriptionId, datadogOrganizationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// List all monitors under the specified subscription. /// 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 0000000000000..96e74d5a28ccc --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/LongRunningOperation/MonitoredSubscriptionPropertyOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +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) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return new MonitoredSubscriptionPropertyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return new MonitoredSubscriptionPropertyResource(_client, data); + } + } +} diff --git a/sdk/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 0000000000000..b41d42904a666 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class CreateResourceSupportedProperties + { + internal static CreateResourceSupportedProperties DeserializeCreateResourceSupportedProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional creationSupported = default; + 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; + } + } + return new CreateResourceSupportedProperties(name.Value, Optional.ToNullable(creationSupported)); + } + } +} 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 0000000000000..9a719f0ffbe3f --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Datadog.Models +{ + /// Datadog resource can be created or not properties. + public partial class CreateResourceSupportedProperties + { + /// Initializes a new instance of CreateResourceSupportedProperties. + internal CreateResourceSupportedProperties() + { + } + + /// Initializes a new instance of CreateResourceSupportedProperties. + /// 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. + internal CreateResourceSupportedProperties(string name, bool? creationSupported) + { + Name = name; + CreationSupported = creationSupported; + } + + /// 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/CreateResourceSupportedResponse.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponse.Serialization.cs new file mode 100644 index 0000000000000..76690d946422f --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponse.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class CreateResourceSupportedResponse + { + internal static CreateResourceSupportedResponse DeserializeCreateResourceSupportedResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = CreateResourceSupportedProperties.DeserializeCreateResourceSupportedProperties(property.Value); + continue; + } + } + return new CreateResourceSupportedResponse(properties.Value); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponse.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponse.cs new file mode 100644 index 0000000000000..981427d66d192 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponse.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Datadog.Models +{ + /// Datadog resource can be created or not. + public partial class CreateResourceSupportedResponse + { + /// Initializes a new instance of CreateResourceSupportedResponse. + internal CreateResourceSupportedResponse() + { + } + + /// Initializes a new instance of CreateResourceSupportedResponse. + /// Represents the properties of the resource. + internal CreateResourceSupportedResponse(CreateResourceSupportedProperties properties) + { + Properties = properties; + } + + /// Represents the properties of the resource. + public CreateResourceSupportedProperties Properties { 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 0000000000000..f8354b590c558 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + internal partial class CreateResourceSupportedResponseList + { + internal static CreateResourceSupportedResponseList DeserializeCreateResourceSupportedResponseList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CreateResourceSupportedResponse.DeserializeCreateResourceSupportedResponse(item)); + } + value = array; + continue; + } + } + return new CreateResourceSupportedResponseList(Optional.ToList(value)); + } + } +} 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 0000000000000..6eb656a289d57 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/CreateResourceSupportedResponseList.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// The CreateResourceSupportedResponseList. + internal partial class CreateResourceSupportedResponseList + { + /// Initializes a new instance of CreateResourceSupportedResponseList. + internal CreateResourceSupportedResponseList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CreateResourceSupportedResponseList. + /// + internal CreateResourceSupportedResponseList(IReadOnlyList value) + { + Value = value; + } + + /// Gets the value. + public IReadOnlyList Value { 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 a2d015101e29c..1584fda5e42c5 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHost.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogHost.cs @@ -22,7 +22,7 @@ internal DatadogHost() /// Initializes a new instance of DatadogHost. /// 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. /// internal DatadogHost(string name, IReadOnlyList aliases, IReadOnlyList apps, DatadogHostMetadata meta) @@ -35,7 +35,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/DatadogMonitorResourcePatch.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs index d6dd96b69939f..c9968318d6e61 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogMonitorResourcePatch.cs @@ -20,24 +20,12 @@ public DatadogMonitorResourcePatch() } /// 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. + /// Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. 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 e1ec0a19455fe..108e3c7b8f172 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 @@ -16,6 +16,16 @@ public partial class DatadogOrganizationProperties : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } if (Optional.IsDefined(LinkingAuthCode)) { writer.WritePropertyName("linkingAuthCode"u8); @@ -46,6 +56,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("enterpriseAppId"u8); writer.WriteStringValue(EnterpriseAppId); } + if (Optional.IsDefined(Cspm)) + { + writer.WritePropertyName("cspm"u8); + writer.WriteBooleanValue(Cspm.Value); + } writer.WriteEndObject(); } @@ -63,6 +78,7 @@ internal static DatadogOrganizationProperties DeserializeDatadogOrganizationProp Optional apiKey = default; Optional applicationKey = default; Optional enterpriseAppId = default; + Optional cspm = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name"u8)) @@ -109,8 +125,17 @@ 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; + } } - return new DatadogOrganizationProperties(name.Value, id.Value, linkingAuthCode.Value, linkingClientId.Value, redirectUri.Value, apiKey.Value, applicationKey.Value, enterpriseAppId.Value); + return new DatadogOrganizationProperties(name.Value, id.Value, linkingAuthCode.Value, linkingClientId.Value, redirectUri.Value, apiKey.Value, applicationKey.Value, enterpriseAppId.Value, Optional.ToNullable(cspm)); } } } 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 2eb74f50d08b3..5e0e4db3d84ed 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/DatadogOrganizationProperties.cs @@ -9,7 +9,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 { /// Initializes a new instance of DatadogOrganizationProperties. @@ -20,13 +20,14 @@ public DatadogOrganizationProperties() /// Initializes a new instance of DatadogOrganizationProperties. /// 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. - internal DatadogOrganizationProperties(string name, string id, string linkingAuthCode, string linkingClientId, Uri redirectUri, string apiKey, string applicationKey, string enterpriseAppId) + /// 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. + internal DatadogOrganizationProperties(string name, string id, string linkingAuthCode, string linkingClientId, Uri redirectUri, string apiKey, string applicationKey, string enterpriseAppId, bool? cspm) { Name = name; Id = id; @@ -36,17 +37,18 @@ internal DatadogOrganizationProperties(string name, string id, string linkingAut ApiKey = apiKey; ApplicationKey = applicationKey; EnterpriseAppId = enterpriseAppId; + Cspm = cspm; } /// 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. + /// The redirect URI for linking. public Uri RedirectUri { get; set; } /// Api key associated to the Datadog organization. public string ApiKey { get; set; } @@ -54,5 +56,7 @@ internal DatadogOrganizationProperties(string name, string id, string linkingAut 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/MonitorProperties.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs index fce23ce4dc61a..9e59bbd61cade 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorProperties.cs @@ -19,8 +19,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. internal MonitorProperties(ProvisioningState? provisioningState, MonitoringStatus? monitoringStatus, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, DatadogOrganizationProperties datadogOrganizationProperties, UserInfo userInfo, LiftrResourceCategory? liftrResourceCategory, int? liftrResourcePreference) @@ -40,9 +40,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 18b9d48561e88..0f136fb07402a 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 @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Datadog.Models { - internal partial class MonitorUpdateProperties : IUtf8JsonSerializable + public partial class MonitorUpdateProperties : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -20,6 +20,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("monitoringStatus"u8); writer.WriteStringValue(MonitoringStatus.Value.ToString()); } + if (Optional.IsDefined(Cspm)) + { + writer.WritePropertyName("cspm"u8); + writer.WriteBooleanValue(Cspm.Value); + } writer.WriteEndObject(); } } 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 7801e11aceaed..1453264bb52eb 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitorUpdateProperties.cs @@ -8,7 +8,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 { /// Initializes a new instance of MonitorUpdateProperties. public MonitorUpdateProperties() @@ -17,5 +17,7 @@ public MonitorUpdateProperties() /// 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/MonitoredSubscription.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.Serialization.cs new file mode 100644 index 0000000000000..4d7663d400b36 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class MonitoredSubscription : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(TagRules)) + { + writer.WritePropertyName("tagRules"u8); + writer.WriteObjectValue(TagRules); + } + writer.WriteEndObject(); + } + + internal static MonitoredSubscription DeserializeMonitoredSubscription(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional subscriptionId = default; + Optional status = default; + Optional error = default; + Optional tagRules = default; + 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); + continue; + } + } + return new MonitoredSubscription(subscriptionId.Value, Optional.ToNullable(status), error.Value, tagRules.Value); + } + } +} 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 0000000000000..b8f6cdc001672 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscription.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Datadog.Models +{ + /// The list of subscriptions and it's monitoring status by current Datadog monitor. + public partial class MonitoredSubscription + { + /// Initializes a new instance of MonitoredSubscription. + public MonitoredSubscription() + { + } + + /// Initializes a new instance of MonitoredSubscription. + /// The subscriptionId to be monitored. + /// The state of monitoring. + /// The reason of not monitoring the subscription. + /// Definition of the properties for a TagRules resource. + internal MonitoredSubscription(string subscriptionId, Status? status, string error, MonitoringTagRulesProperties tagRules) + { + SubscriptionId = subscriptionId; + Status = status; + Error = error; + TagRules = tagRules; + } + + /// 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 0000000000000..90f142dd32377 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Datadog; + +namespace Azure.ResourceManager.Datadog.Models +{ + internal partial class MonitoredSubscriptionPropertiesList + { + internal static MonitoredSubscriptionPropertiesList DeserializeMonitoredSubscriptionPropertiesList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(item)); + } + value = array; + continue; + } + } + return new MonitoredSubscriptionPropertiesList(Optional.ToList(value)); + } + } +} 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 0000000000000..e990e0a74cea3 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertiesList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Datadog; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// The MonitoredSubscriptionPropertiesList. + internal partial class MonitoredSubscriptionPropertiesList + { + /// Initializes a new instance of MonitoredSubscriptionPropertiesList. + internal MonitoredSubscriptionPropertiesList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of MonitoredSubscriptionPropertiesList. + /// + internal MonitoredSubscriptionPropertiesList(IReadOnlyList value) + { + Value = value; + } + + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertyData.Serialization.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertyData.Serialization.cs new file mode 100644 index 0000000000000..55eab6af57822 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoredSubscriptionPropertyData.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +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 + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + + internal static MonitoredSubscriptionPropertyData DeserializeMonitoredSubscriptionPropertyData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = SubscriptionList.DeserializeSubscriptionList(property.Value); + 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; + } + } + return new MonitoredSubscriptionPropertyData(id, name, type, systemData.Value, properties.Value); + } + } +} 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 5de6bd3c0d7d4..df1ec99038dd7 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 @@ -25,6 +25,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("metricRules"u8); writer.WriteObjectValue(MetricRules); } + if (Optional.IsDefined(Automuting)) + { + writer.WritePropertyName("automuting"u8); + writer.WriteBooleanValue(Automuting.Value); + } writer.WriteEndObject(); } @@ -37,6 +42,7 @@ internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProper Optional provisioningState = default; Optional logRules = default; Optional metricRules = default; + Optional automuting = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState"u8)) @@ -66,8 +72,17 @@ internal static MonitoringTagRulesProperties DeserializeMonitoringTagRulesProper metricRules = MetricRules.DeserializeMetricRules(property.Value); continue; } + if (property.NameEquals("automuting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + automuting = property.Value.GetBoolean(); + continue; + } } - return new MonitoringTagRulesProperties(Optional.ToNullable(provisioningState), logRules.Value, metricRules.Value); + return new MonitoringTagRulesProperties(Optional.ToNullable(provisioningState), logRules.Value, metricRules.Value, Optional.ToNullable(automuting)); } } } 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 4d064bf580fe3..f1e560759e100 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/MonitoringTagRulesProperties.cs @@ -21,11 +21,13 @@ public MonitoringTagRulesProperties() /// /// Set of rules for sending logs for the Monitor resource. /// Set of rules for sending metrics for the Monitor resource. - internal MonitoringTagRulesProperties(ProvisioningState? provisioningState, LogRules logRules, MetricRules metricRules) + /// Configuration to enable/disable auto-muting flag. + internal MonitoringTagRulesProperties(ProvisioningState? provisioningState, LogRules logRules, MetricRules metricRules, bool? automuting) { ProvisioningState = provisioningState; LogRules = logRules; MetricRules = metricRules; + Automuting = automuting; } /// Gets the provisioning state. @@ -44,5 +46,8 @@ public IList MetricRulesFilteringTags return MetricRules.FilteringTags; } } + + /// Configuration to enable/disable auto-muting flag. + public bool? Automuting { 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 0000000000000..93a1e7eb4a1ab --- /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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} 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 57c9afc74c20b..610b9b88f6d9e 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/ResourceSku.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/ResourceSku.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.Datadog.Models internal partial class ResourceSku { /// Initializes a new instance of ResourceSku. - /// Name of the SKU. + /// Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. /// is null. public ResourceSku(string name) { @@ -23,7 +23,7 @@ public ResourceSku(string name) Name = name; } - /// Name of the SKU. + /// Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. 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 0000000000000..0ee9c76a2bc27 --- /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 string to a . + public static implicit operator Status(string value) => new Status(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Status other && Equals(other); + /// + public bool Equals(Status other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 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 0000000000000..52ee994ff5eed --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + public partial class SubscriptionList : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + 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); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static SubscriptionList DeserializeSubscriptionList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional operation = default; + Optional> monitoredSubscriptionList = default; + 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)); + } + monitoredSubscriptionList = array; + continue; + } + } + return new SubscriptionList(Optional.ToNullable(operation), Optional.ToList(monitoredSubscriptionList)); + } + } +} 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 0000000000000..60b194f8f62a7 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/SubscriptionList.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Datadog.Models +{ + /// The request to update subscriptions needed to be monitored by the Datadog monitor resource. + public partial class SubscriptionList + { + /// Initializes a new instance of SubscriptionList. + public SubscriptionList() + { + MonitoredSubscriptionList = new ChangeTrackingList(); + } + + /// Initializes a new instance of SubscriptionList. + /// The operation for the patch on the resource. + /// List of subscriptions and the state of the monitoring. + internal SubscriptionList(Operation? operation, IList monitoredSubscriptionList) + { + Operation = operation; + MonitoredSubscriptionList = monitoredSubscriptionList; + } + + /// 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 0a8561a6432a8..834ce65c7e632 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/UserInfo.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Models/UserInfo.cs @@ -7,7 +7,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 { /// Initializes a new instance of 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 0000000000000..d21fd4898c3ec --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyCollection.cs @@ -0,0 +1,339 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +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 + /// MonitoredSubscriptions_CreateorUpdate + /// + /// + /// + /// 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 MonitoredSubscriptionProperty 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(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateorUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add the subscriptions that should be monitored by the Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_CreateorUpdate + /// + /// + /// + /// 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 MonitoredSubscriptionProperty 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(new MonitoredSubscriptionPropertyOperationSource(Client), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, _monitoredSubscriptionPropertyMonitoredSubscriptionsRestClient.CreateCreateorUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the subscriptions currently being monitored by the Datadog monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName} + /// + /// + /// Operation Id + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_List + /// + /// + /// + /// 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); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MonitoredSubscriptionPropertyResource(Client, MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(e)), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, "MonitoredSubscriptionPropertyCollection.GetAll", "value", null, 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 + /// MonitoredSubscriptions_List + /// + /// + /// + /// 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); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MonitoredSubscriptionPropertyResource(Client, MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(e)), _monitoredSubscriptionPropertyMonitoredSubscriptionsClientDiagnostics, Pipeline, "MonitoredSubscriptionPropertyCollection.GetAll", "value", null, 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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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; + } + } + + 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.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.cs new file mode 100644 index 0000000000000..56249c716fe7c --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyData.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +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 + { + /// Initializes a new instance of MonitoredSubscriptionPropertyData. + public MonitoredSubscriptionPropertyData() + { + } + + /// Initializes a new instance of MonitoredSubscriptionPropertyData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The request to update subscriptions needed to be monitored by the Datadog monitor resource. + internal MonitoredSubscriptionPropertyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubscriptionList properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// 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.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs new file mode 100644 index 0000000000000..41950df87404b --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/MonitoredSubscriptionPropertyResource.cs @@ -0,0 +1,297 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +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. + 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; + + /// 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 the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Datadog/monitors/monitoredSubscriptions"; + + /// 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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_Get + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_Delete + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_Delete + /// + /// + /// + /// 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 + /// MonitoredSubscriptions_Update + /// + /// + /// + /// 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 MonitoredSubscriptionProperty 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 + /// MonitoredSubscriptions_Update + /// + /// + /// + /// 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 MonitoredSubscriptionProperty 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/RestOperations/CreationSupportedRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedRestOperations.cs new file mode 100644 index 0000000000000..f65defef15a2d --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/CreationSupportedRestOperations.cs @@ -0,0 +1,184 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Datadog.Models; + +namespace Azure.ResourceManager.Datadog +{ + internal partial class CreationSupportedRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CreationSupportedRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public CreationSupportedRestOperations(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-01-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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. + /// 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, default, 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. + /// 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); + value = CreateResourceSupportedResponseList.DeserializeCreateResourceSupportedResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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. + /// 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: + { + CreateResourceSupportedResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CreateResourceSupportedResponse.DeserializeCreateResourceSupportedResponse(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. + /// 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: + { + CreateResourceSupportedResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CreateResourceSupportedResponse.DeserializeCreateResourceSupportedResponse(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/MarketplaceAgreementsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsRestOperations.cs index d02c34f34bbff..b5a0d48abb579 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MarketplaceAgreementsRestOperations.cs @@ -33,7 +33,7 @@ public MarketplaceAgreementsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 0000000000000..0af9cf61e52f4 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitoredSubscriptionsRestOperations.cs @@ -0,0 +1,455 @@ +// 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; +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. + /// server parameter. + /// Api Version. + /// or is null. + public MonitoredSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-01-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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 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, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the subscriptions currently being monitored by the Datadog monitor resource. + /// The ID of the target subscription. + /// 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); + value = MonitoredSubscriptionPropertiesList.DeserializeMonitoredSubscriptionPropertiesList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 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, default, cancellationToken).ConfigureAwait(false); + value = MonitoredSubscriptionPropertyData.DeserializeMonitoredSubscriptionPropertyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MonitoredSubscriptionPropertyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the subscriptions currently being monitored by the Datadog monitor resource. + /// The ID of the target subscription. + /// 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); + 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 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); + 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 name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The MonitoredSubscriptionProperty 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 name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The MonitoredSubscriptionProperty 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 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); + 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 name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The MonitoredSubscriptionProperty 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 name of the resource group. The name is case insensitive. + /// Monitor resource name. + /// The configuration name. Only 'default' value is supported. + /// The MonitoredSubscriptionProperty 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 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 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 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 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 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); + } + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs index d943a570a5f65..13c719c7044e9 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/MonitorsRestOperations.cs @@ -33,7 +33,7 @@ public MonitorsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs index c78ba4c91b208..f172d016173bf 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/SingleSignOnConfigurationsRestOperations.cs @@ -33,7 +33,7 @@ public SingleSignOnConfigurationsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 fa3479a0b7c1f..07b1980c0220d 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/TagRulesRestOperations.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/RestOperations/TagRulesRestOperations.cs @@ -33,7 +33,7 @@ public TagRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-03-01"; + _apiVersion = apiVersion ?? "2023-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md b/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md index f22918e5825c8..e664afcaff09d 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/autorest.md @@ -8,7 +8,7 @@ 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 +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datadog/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true