From 5729c066e41d45fff0709380593294b506e58909 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 19 Sep 2023 09:28:01 +0000 Subject: [PATCH] CodeGen from PR 24495 in Azure/azure-rest-api-specs Merge b3787774f5f07ba4c3647832d2b882a25611d11a into 88df06144633273e2bb5d8e48a790e3c460887be --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-datadog/README.md | 6 +- .../azure-resourcemanager-datadog/SAMPLE.md | 206 ++- .../azure-resourcemanager-datadog/pom.xml | 11 +- .../datadog/MicrosoftDatadogManager.java | 41 +- .../fluent/CreationSupportedsClient.java | 65 + .../fluent/MicrosoftDatadogClient.java | 14 + .../fluent/MonitoredSubscriptionsClient.java | 282 ++++ .../datadog/fluent/OperationsClient.java | 4 +- .../CreateResourceSupportedResponseInner.java | 54 + .../fluent/models/DatadogHostInner.java | 6 +- .../MonitoredSubscriptionPropertiesInner.java | 101 ++ .../CreateResourceSupportedResponseImpl.java | 34 + .../CreationSupportedsClientImpl.java | 362 ++++ .../CreationSupportedsImpl.java | 72 + .../MicrosoftDatadogClientBuilder.java | 2 +- .../MicrosoftDatadogClientImpl.java | 30 +- .../MonitoredSubscriptionPropertiesImpl.java | 141 ++ .../MonitoredSubscriptionsClientImpl.java | 1483 +++++++++++++++++ .../MonitoredSubscriptionsImpl.java | 204 +++ .../implementation/MonitorsClientImpl.java | 33 +- .../implementation/OperationsClientImpl.java | 12 +- .../SingleSignOnConfigurationsClientImpl.java | 9 +- .../implementation/TagRulesClientImpl.java | 9 +- .../CreateResourceSupportedProperties.java | 56 + .../CreateResourceSupportedResponse.java | 24 + .../CreateResourceSupportedResponseList.java | 55 + .../datadog/models/CreationSupporteds.java | 58 + .../datadog/models/DatadogHost.java | 2 +- .../models/DatadogMonitorResource.java | 13 + .../models/DatadogOrganizationProperties.java | 74 +- .../models/DatadogSingleSignOnResource.java | 7 + .../datadog/models/IdentityProperties.java | 8 +- .../datadog/models/ManagedIdentityTypes.java | 2 +- .../datadog/models/MonitorProperties.java | 15 +- .../models/MonitorUpdateProperties.java | 29 + .../datadog/models/MonitoredSubscription.java | 131 ++ .../MonitoredSubscriptionProperties.java | 168 ++ .../MonitoredSubscriptionPropertiesList.java | 55 + .../models/MonitoredSubscriptions.java | 145 ++ .../datadog/models/MonitoringTagRules.java | 7 + .../models/MonitoringTagRulesProperties.java | 26 + .../datadog/models/Operation.java | 56 + .../datadog/models/Operations.java | 4 +- .../datadog/models/ResourceSku.java | 6 +- .../datadog/models/Status.java | 53 + .../datadog/models/SubscriptionList.java | 80 + .../datadog/models/UserInfo.java | 2 +- .../CreationSupportedGetSamples.java | 20 + .../CreationSupportedListSamples.java | 20 + ...tplaceAgreementsCreateOrUpdateSamples.java | 2 +- .../MarketplaceAgreementsListSamples.java | 2 +- ...redSubscriptionsCreateorUpdateSamples.java | 21 + .../MonitoredSubscriptionsDeleteSamples.java | 23 + .../MonitoredSubscriptionsGetSamples.java | 23 + .../MonitoredSubscriptionsListSamples.java | 21 + .../MonitoredSubscriptionsUpdateSamples.java | 28 + .../generated/MonitorsCreateSamples.java | 2 +- .../generated/MonitorsDeleteSamples.java | 2 +- .../MonitorsGetByResourceGroupSamples.java | 2 +- .../MonitorsGetDefaultKeySamples.java | 2 +- .../generated/MonitorsListApiKeysSamples.java | 2 +- .../MonitorsListByResourceGroupSamples.java | 2 +- .../generated/MonitorsListHostsSamples.java | 2 +- .../MonitorsListLinkedResourcesSamples.java | 2 +- ...MonitorsListMonitoredResourcesSamples.java | 2 +- .../generated/MonitorsListSamples.java | 2 +- ...MonitorsRefreshSetPasswordLinkSamples.java | 2 +- .../MonitorsSetDefaultKeySamples.java | 2 +- .../generated/MonitorsUpdateSamples.java | 2 +- .../generated/OperationsListSamples.java | 2 +- ...OnConfigurationsCreateOrUpdateSamples.java | 2 +- .../SingleSignOnConfigurationsGetSamples.java | 2 +- ...SingleSignOnConfigurationsListSamples.java | 2 +- .../TagRulesCreateOrUpdateSamples.java | 2 +- .../datadog/generated/TagRulesGetSamples.java | 2 +- .../generated/TagRulesListSamples.java | 2 +- .../DatadogAgreementPropertiesTests.java | 52 - .../DatadogAgreementResourceInnerTests.java | 55 - ...dogAgreementResourceListResponseTests.java | 90 - .../generated/DatadogHostInnerTests.java | 59 - .../DatadogHostListResponseTests.java | 64 - .../generated/DatadogHostMetadataTests.java | 46 - .../generated/DatadogInstallMethodTests.java | 32 - .../generated/DatadogLogsAgentTests.java | 25 - ...tadogMonitorResourceListResponseTests.java | 96 -- ...gMonitorResourceUpdateParametersTests.java | 52 - .../DatadogSingleSignOnPropertiesTests.java | 34 - ...DatadogSingleSignOnResourceInnerTests.java | 37 - ...SingleSignOnResourceListResponseTests.java | 56 - .../datadog/generated/FilteringTagTests.java | 32 - .../generated/IdentityPropertiesTests.java | 28 - .../generated/LinkedResourceInnerTests.java | 24 - .../LinkedResourceListResponseTests.java | 41 - .../datadog/generated/LogRulesTests.java | 50 - ...tsCreateOrUpdateWithResponseMockTests.java | 91 - .../MarketplaceAgreementsListMockTests.java | 78 - .../datadog/generated/MetricRulesTests.java | 47 - .../MonitorUpdatePropertiesTests.java | 26 - .../MonitoredResourceInnerTests.java | 42 - .../MonitoredResourceListResponseTests.java | 69 - .../MonitoringTagRulesInnerTests.java | 46 - .../MonitoringTagRulesListResponseTests.java | 40 - .../MonitoringTagRulesPropertiesTests.java | 87 - .../generated/MonitorsDeleteMockTests.java | 61 - .../generated/MonitorsListHostsMockTests.java | 75 - .../MonitorsListLinkedResourcesMockTests.java | 67 - ...nitorsListMonitoredResourcesMockTests.java | 72 - .../generated/OperationDisplayTests.java | 39 - .../generated/OperationListResultTests.java | 84 - .../generated/OperationResultInnerTests.java | 48 - .../generated/OperationsListMockTests.java | 72 - .../datadog/generated/ResourceSkuTests.java | 24 - ...ConfigurationsCreateOrUpdateMockTests.java | 78 - ...onfigurationsGetWithResponseMockTests.java | 72 - ...ngleSignOnConfigurationsListMockTests.java | 71 - ...esCreateOrUpdateWithResponseMockTests.java | 86 - .../TagRulesGetWithResponseMockTests.java | 72 - .../generated/TagRulesListMockTests.java | 70 - .../datadog/generated/UserInfoTests.java | 31 - 120 files changed, 4336 insertions(+), 2546 deletions(-) create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/CreationSupportedsClient.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MonitoredSubscriptionsClient.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/CreateResourceSupportedResponseInner.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/MonitoredSubscriptionPropertiesInner.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreateResourceSupportedResponseImpl.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsClientImpl.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsImpl.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionPropertiesImpl.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsClientImpl.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsImpl.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedProperties.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponse.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponseList.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreationSupporteds.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscription.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionProperties.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionPropertiesList.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptions.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operation.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Status.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/SubscriptionList.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedGetSamples.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedListSamples.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsCreateorUpdateSamples.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsDeleteSamples.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsGetSamples.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsListSamples.java create mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsUpdateSamples.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementPropertiesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostMetadataTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogInstallMethodTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogLogsAgentTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceUpdateParametersTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnPropertiesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/FilteringTagTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/IdentityPropertiesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LogRulesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MetricRulesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorUpdatePropertiesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesListResponseTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesPropertiesTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationDisplayTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationListResultTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationResultInnerTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationsListMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/ResourceSkuTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetWithResponseMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesGetWithResponseMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesListMockTests.java delete mode 100644 sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/UserInfoTests.java diff --git a/sdk/datadog/azure-resourcemanager-datadog/CHANGELOG.md b/sdk/datadog/azure-resourcemanager-datadog/CHANGELOG.md index 409a9c97407b4..13277a754cd70 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/CHANGELOG.md +++ b/sdk/datadog/azure-resourcemanager-datadog/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.1 (2023-09-19) + +- Azure Resource Manager MicrosoftDatadog client library for Java. This package contains Microsoft Azure SDK for MicrosoftDatadog Management SDK. Package tag package-2023-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/datadog/azure-resourcemanager-datadog/README.md b/sdk/datadog/azure-resourcemanager-datadog/README.md index bcec34dad1dc0..2d89035406300 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/README.md +++ b/sdk/datadog/azure-resourcemanager-datadog/README.md @@ -2,7 +2,7 @@ Azure Resource Manager MicrosoftDatadog client library for Java. -This package contains Microsoft Azure SDK for MicrosoftDatadog Management SDK. Package tag package-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for MicrosoftDatadog Management SDK. Package tag package-2023-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-datadog - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fdatadog%2Fazure-resourcemanager-datadog%2FREADME.png) diff --git a/sdk/datadog/azure-resourcemanager-datadog/SAMPLE.md b/sdk/datadog/azure-resourcemanager-datadog/SAMPLE.md index 9223ac89a5909..7532268a171d9 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/SAMPLE.md +++ b/sdk/datadog/azure-resourcemanager-datadog/SAMPLE.md @@ -1,11 +1,24 @@ # Code snippets and samples +## CreationSupported + +- [Get](#creationsupported_get) +- [List](#creationsupported_list) + ## MarketplaceAgreements - [CreateOrUpdate](#marketplaceagreements_createorupdate) - [List](#marketplaceagreements_list) +## MonitoredSubscriptions + +- [CreateorUpdate](#monitoredsubscriptions_createorupdate) +- [Delete](#monitoredsubscriptions_delete) +- [Get](#monitoredsubscriptions_get) +- [List](#monitoredsubscriptions_list) +- [Update](#monitoredsubscriptions_update) + ## Monitors - [Create](#monitors_create) @@ -37,13 +50,51 @@ - [CreateOrUpdate](#tagrules_createorupdate) - [Get](#tagrules_get) - [List](#tagrules_list) +### CreationSupported_Get + +```java +/** Samples for CreationSupported Get. */ +public final class CreationSupportedGetSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/CreationSupported_Get.json + */ + /** + * Sample code: CreationSupported_Get. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void creationSupportedGet(com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.creationSupporteds().getWithResponse("00000000-0000-0000-0000", com.azure.core.util.Context.NONE); + } +} +``` + +### CreationSupported_List + +```java +/** Samples for CreationSupported List. */ +public final class CreationSupportedListSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/CreationSupported_List.json + */ + /** + * Sample code: CreationSupported_List. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void creationSupportedList(com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.creationSupporteds().list("00000000-0000-0000-0000", com.azure.core.util.Context.NONE); + } +} +``` + ### MarketplaceAgreements_CreateOrUpdate ```java /** Samples for MarketplaceAgreements CreateOrUpdate. */ public final class MarketplaceAgreementsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_Create.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MarketplaceAgreements_Create.json */ /** * Sample code: MarketplaceAgreements_CreateOrUpdate. @@ -63,7 +114,7 @@ public final class MarketplaceAgreementsCreateOrUpdateSamples { /** Samples for MarketplaceAgreements List. */ public final class MarketplaceAgreementsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MarketplaceAgreements_List.json */ /** * Sample code: MarketplaceAgreements_List. @@ -76,13 +127,124 @@ public final class MarketplaceAgreementsListSamples { } ``` +### MonitoredSubscriptions_CreateorUpdate + +```java +/** Samples for MonitoredSubscriptions CreateorUpdate. */ +public final class MonitoredSubscriptionsCreateorUpdateSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_CreateorUpdate.json + */ + /** + * Sample code: Monitors_AddMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsAddMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.monitoredSubscriptions().define("default").withExistingMonitor("myResourceGroup", "myMonitor").create(); + } +} +``` + +### MonitoredSubscriptions_Delete + +```java +/** Samples for MonitoredSubscriptions Delete. */ +public final class MonitoredSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_Delete.json + */ + /** + * Sample code: Monitors_DeleteMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsDeleteMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager + .monitoredSubscriptions() + .delete("myResourceGroup", "myMonitor", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_Get + +```java +/** Samples for MonitoredSubscriptions Get. */ +public final class MonitoredSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_Get.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager + .monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_List + +```java +/** Samples for MonitoredSubscriptions List. */ +public final class MonitoredSubscriptionsListSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_List.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.monitoredSubscriptions().list("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoredSubscriptions_Update + +```java +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptionProperties; + +/** Samples for MonitoredSubscriptions Update. */ +public final class MonitoredSubscriptionsUpdateSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_Update.json + */ + /** + * Sample code: Monitors_UpdateMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsUpdateMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + MonitoredSubscriptionProperties resource = + manager + .monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + ### Monitors_Create ```java /** Samples for Monitors Create. */ public final class MonitorsCreateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Create.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Create.json */ /** * Sample code: Monitors_Create. @@ -106,7 +268,7 @@ public final class MonitorsCreateSamples { /** Samples for Monitors Delete. */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Delete.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Delete.json */ /** * Sample code: Monitors_Delete. @@ -125,7 +287,7 @@ public final class MonitorsDeleteSamples { /** Samples for Monitors GetByResourceGroup. */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Get.json */ /** * Sample code: Monitors_Get. @@ -146,7 +308,7 @@ public final class MonitorsGetByResourceGroupSamples { /** Samples for Monitors GetDefaultKey. */ public final class MonitorsGetDefaultKeySamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_GetDefaultKey.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/ApiKeys_GetDefaultKey.json */ /** * Sample code: Monitors_GetDefaultKey. @@ -165,7 +327,7 @@ public final class MonitorsGetDefaultKeySamples { /** Samples for Monitors List. */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_List.json */ /** * Sample code: Monitors_List. @@ -184,7 +346,7 @@ public final class MonitorsListSamples { /** Samples for Monitors ListApiKeys. */ public final class MonitorsListApiKeysSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/ApiKeys_List.json */ /** * Sample code: Monitors_ListApiKeys. @@ -203,7 +365,7 @@ public final class MonitorsListApiKeysSamples { /** Samples for Monitors ListByResourceGroup. */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_ListByResourceGroup.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_ListByResourceGroup.json */ /** * Sample code: Monitors_ListByResourceGroup. @@ -222,7 +384,7 @@ public final class MonitorsListByResourceGroupSamples { /** Samples for Monitors ListHosts. */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Hosts_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Hosts_List.json */ /** * Sample code: Monitors_ListHosts. @@ -241,7 +403,7 @@ public final class MonitorsListHostsSamples { /** Samples for Monitors ListLinkedResources. */ public final class MonitorsListLinkedResourcesSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/LinkedResources_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/LinkedResources_List.json */ /** * Sample code: Monitors_ListLinkedResources. @@ -260,7 +422,7 @@ public final class MonitorsListLinkedResourcesSamples { /** Samples for Monitors ListMonitoredResources. */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MonitoredResources_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredResources_List.json */ /** * Sample code: Monitors_ListMonitoredResources. @@ -280,7 +442,7 @@ public final class MonitorsListMonitoredResourcesSamples { /** Samples for Monitors RefreshSetPasswordLink. */ public final class MonitorsRefreshSetPasswordLinkSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/RefreshSetPassword_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/RefreshSetPassword_Get.json */ /** * Sample code: Monitors_RefreshSetPasswordLink. @@ -302,7 +464,7 @@ public final class MonitorsRefreshSetPasswordLinkSamples { /** Samples for Monitors SetDefaultKey. */ public final class MonitorsSetDefaultKeySamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_SetDefaultKey.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/ApiKeys_SetDefaultKey.json */ /** * Sample code: Monitors_SetDefaultKey. @@ -325,7 +487,7 @@ import com.azure.resourcemanager.datadog.models.DatadogMonitorResource; /** Samples for Monitors Update. */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Update.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Update.json */ /** * Sample code: Monitors_Update. @@ -349,7 +511,7 @@ public final class MonitorsUpdateSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Operations_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Operations_List.json */ /** * Sample code: Operations_List. @@ -368,7 +530,7 @@ public final class OperationsListSamples { /** Samples for SingleSignOnConfigurations CreateOrUpdate. */ public final class SingleSignOnConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json */ /** * Sample code: SingleSignOnConfigurations_CreateOrUpdate. @@ -392,7 +554,7 @@ public final class SingleSignOnConfigurationsCreateOrUpdateSamples { /** Samples for SingleSignOnConfigurations Get. */ public final class SingleSignOnConfigurationsGetSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/SingleSignOnConfigurations_Get.json */ /** * Sample code: SingleSignOnConfigurations_Get. @@ -414,7 +576,7 @@ public final class SingleSignOnConfigurationsGetSamples { /** Samples for SingleSignOnConfigurations List. */ public final class SingleSignOnConfigurationsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/SingleSignOnConfigurations_List.json */ /** * Sample code: SingleSignOnConfigurations_List. @@ -434,7 +596,7 @@ public final class SingleSignOnConfigurationsListSamples { /** Samples for TagRules CreateOrUpdate. */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_CreateOrUpdate.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/TagRules_CreateOrUpdate.json */ /** * Sample code: TagRules_CreateOrUpdate. @@ -453,7 +615,7 @@ public final class TagRulesCreateOrUpdateSamples { /** Samples for TagRules Get. */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/TagRules_Get.json */ /** * Sample code: TagRules_Get. @@ -472,7 +634,7 @@ public final class TagRulesGetSamples { /** Samples for TagRules List. */ public final class TagRulesListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/TagRules_List.json */ /** * Sample code: TagRules_List. diff --git a/sdk/datadog/azure-resourcemanager-datadog/pom.xml b/sdk/datadog/azure-resourcemanager-datadog/pom.xml index 7319e28c637e0..6422254c17e7f 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/pom.xml +++ b/sdk/datadog/azure-resourcemanager-datadog/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for MicrosoftDatadog Management - This package contains Microsoft Azure SDK for MicrosoftDatadog Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-03. + This package contains Microsoft Azure SDK for MicrosoftDatadog Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2023-01. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/MicrosoftDatadogManager.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/MicrosoftDatadogManager.java index 9c43e7a6b4c16..0715632407bf0 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/MicrosoftDatadogManager.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/MicrosoftDatadogManager.java @@ -24,13 +24,17 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datadog.fluent.MicrosoftDatadogClient; +import com.azure.resourcemanager.datadog.implementation.CreationSupportedsImpl; import com.azure.resourcemanager.datadog.implementation.MarketplaceAgreementsImpl; import com.azure.resourcemanager.datadog.implementation.MicrosoftDatadogClientBuilder; +import com.azure.resourcemanager.datadog.implementation.MonitoredSubscriptionsImpl; import com.azure.resourcemanager.datadog.implementation.MonitorsImpl; import com.azure.resourcemanager.datadog.implementation.OperationsImpl; import com.azure.resourcemanager.datadog.implementation.SingleSignOnConfigurationsImpl; import com.azure.resourcemanager.datadog.implementation.TagRulesImpl; +import com.azure.resourcemanager.datadog.models.CreationSupporteds; import com.azure.resourcemanager.datadog.models.MarketplaceAgreements; +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptions; import com.azure.resourcemanager.datadog.models.Monitors; import com.azure.resourcemanager.datadog.models.Operations; import com.azure.resourcemanager.datadog.models.SingleSignOnConfigurations; @@ -46,6 +50,8 @@ public final class MicrosoftDatadogManager { private MarketplaceAgreements marketplaceAgreements; + private CreationSupporteds creationSupporteds; + private Monitors monitors; private Operations operations; @@ -54,6 +60,8 @@ public final class MicrosoftDatadogManager { private SingleSignOnConfigurations singleSignOnConfigurations; + private MonitoredSubscriptions monitoredSubscriptions; + private final MicrosoftDatadogClient clientObject; private MicrosoftDatadogManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -219,7 +227,7 @@ public MicrosoftDatadogManager authenticate(TokenCredential credential, AzurePro .append("-") .append("com.azure.resourcemanager.datadog") .append("/") - .append("1.0.0-beta.4"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -288,6 +296,18 @@ public MarketplaceAgreements marketplaceAgreements() { return marketplaceAgreements; } + /** + * Gets the resource collection API of CreationSupporteds. + * + * @return Resource collection API of CreationSupporteds. + */ + public CreationSupporteds creationSupporteds() { + if (this.creationSupporteds == null) { + this.creationSupporteds = new CreationSupportedsImpl(clientObject.getCreationSupporteds(), this); + } + return creationSupporteds; + } + /** * Gets the resource collection API of Monitors. It manages DatadogMonitorResource. * @@ -338,8 +358,23 @@ public SingleSignOnConfigurations singleSignOnConfigurations() { } /** - * @return Wrapped service client MicrosoftDatadogClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets the resource collection API of MonitoredSubscriptions. It manages MonitoredSubscriptionProperties. + * + * @return Resource collection API of MonitoredSubscriptions. + */ + public MonitoredSubscriptions monitoredSubscriptions() { + if (this.monitoredSubscriptions == null) { + this.monitoredSubscriptions = + new MonitoredSubscriptionsImpl(clientObject.getMonitoredSubscriptions(), this); + } + return monitoredSubscriptions; + } + + /** + * Gets wrapped service client MicrosoftDatadogClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client MicrosoftDatadogClient. */ public MicrosoftDatadogClient serviceClient() { return this.clientObject; diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/CreationSupportedsClient.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/CreationSupportedsClient.java new file mode 100644 index 0000000000000..bcb4057ebcf63 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/CreationSupportedsClient.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner; + +/** An instance of this class provides access to all the operations defined in CreationSupportedsClient. */ +public interface CreationSupportedsClient { + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String datadogOrganizationId); + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String datadogOrganizationId, Context context); + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String datadogOrganizationId, Context context); + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CreateResourceSupportedResponseInner get(String datadogOrganizationId); +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MicrosoftDatadogClient.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MicrosoftDatadogClient.java index d3fd095cf77d4..28f61a428dd8b 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MicrosoftDatadogClient.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MicrosoftDatadogClient.java @@ -51,6 +51,13 @@ public interface MicrosoftDatadogClient { */ MarketplaceAgreementsClient getMarketplaceAgreements(); + /** + * Gets the CreationSupportedsClient object to access its operations. + * + * @return the CreationSupportedsClient object. + */ + CreationSupportedsClient getCreationSupporteds(); + /** * Gets the MonitorsClient object to access its operations. * @@ -78,4 +85,11 @@ public interface MicrosoftDatadogClient { * @return the SingleSignOnConfigurationsClient object. */ SingleSignOnConfigurationsClient getSingleSignOnConfigurations(); + + /** + * Gets the MonitoredSubscriptionsClient object to access its operations. + * + * @return the MonitoredSubscriptionsClient object. + */ + MonitoredSubscriptionsClient getMonitoredSubscriptions(); } diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MonitoredSubscriptionsClient.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MonitoredSubscriptionsClient.java new file mode 100644 index 0000000000000..783d3701694ce --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/MonitoredSubscriptionsClient.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner; + +/** An instance of this class provides access to all the operations defined in MonitoredSubscriptionsClient. */ +public interface MonitoredSubscriptionsClient { + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String monitorName, Context context); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monitorName, String configurationName); + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate(String resourceGroupName, String monitorName, String configurationName); + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context); + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner createorUpdate( + String resourceGroupName, String monitorName, String configurationName); + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner createorUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> beginUpdate( + String resourceGroupName, String monitorName, String configurationName); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoredSubscriptionPropertiesInner> beginUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, String configurationName); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoredSubscriptionPropertiesInner update( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String configurationName); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String configurationName, Context context); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, String configurationName); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, String configurationName, Context context); +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/OperationsClient.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/OperationsClient.java index bca31ba4ec159..d268735d0518f 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/OperationsClient.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/OperationsClient.java @@ -13,7 +13,7 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -24,7 +24,7 @@ public interface OperationsClient { PagedIterable list(); /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/CreateResourceSupportedResponseInner.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/CreateResourceSupportedResponseInner.java new file mode 100644 index 0000000000000..1c21ee29dfb13 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/CreateResourceSupportedResponseInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datadog.models.CreateResourceSupportedProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Datadog resource can be created or not. */ +@Fluent +public final class CreateResourceSupportedResponseInner { + /* + * Represents the properties of the resource. + */ + @JsonProperty(value = "properties") + private CreateResourceSupportedProperties properties; + + /** Creates an instance of CreateResourceSupportedResponseInner class. */ + public CreateResourceSupportedResponseInner() { + } + + /** + * Get the properties property: Represents the properties of the resource. + * + * @return the properties value. + */ + public CreateResourceSupportedProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Represents the properties of the resource. + * + * @param properties the properties value to set. + * @return the CreateResourceSupportedResponseInner object itself. + */ + public CreateResourceSupportedResponseInner withProperties(CreateResourceSupportedProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/DatadogHostInner.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/DatadogHostInner.java index 45b6c1719c737..44472a4b5d9e4 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/DatadogHostInner.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/DatadogHostInner.java @@ -19,7 +19,7 @@ public final class DatadogHostInner { private String name; /* - * The aliases for the host. + * The aliases for the host installed via the Datadog agent. */ @JsonProperty(value = "aliases") private List aliases; @@ -61,7 +61,7 @@ public DatadogHostInner withName(String name) { } /** - * Get the aliases property: The aliases for the host. + * Get the aliases property: The aliases for the host installed via the Datadog agent. * * @return the aliases value. */ @@ -70,7 +70,7 @@ public List aliases() { } /** - * Set the aliases property: The aliases for the host. + * Set the aliases property: The aliases for the host installed via the Datadog agent. * * @param aliases the aliases value to set. * @return the DatadogHostInner object itself. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/MonitoredSubscriptionPropertiesInner.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/MonitoredSubscriptionPropertiesInner.java new file mode 100644 index 0000000000000..f50278ad8dd3a --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/fluent/models/MonitoredSubscriptionPropertiesInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datadog.models.SubscriptionList; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ +@Fluent +public final class MonitoredSubscriptionPropertiesInner { + /* + * Name of the monitored subscription resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The id of the monitored subscription resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The type of the monitored subscription resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @JsonProperty(value = "properties") + private SubscriptionList properties; + + /** Creates an instance of MonitoredSubscriptionPropertiesInner class. */ + public MonitoredSubscriptionPropertiesInner() { + } + + /** + * Get the name property: Name of the monitored subscription resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The id of the monitored subscription resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: The type of the monitored subscription resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. + * + * @return the properties value. + */ + public SubscriptionList properties() { + return this.properties; + } + + /** + * Set the properties property: The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. + * + * @param properties the properties value to set. + * @return the MonitoredSubscriptionPropertiesInner object itself. + */ + public MonitoredSubscriptionPropertiesInner withProperties(SubscriptionList properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreateResourceSupportedResponseImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreateResourceSupportedResponseImpl.java new file mode 100644 index 0000000000000..78c4e78e11b34 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreateResourceSupportedResponseImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.implementation; + +import com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner; +import com.azure.resourcemanager.datadog.models.CreateResourceSupportedProperties; +import com.azure.resourcemanager.datadog.models.CreateResourceSupportedResponse; + +public final class CreateResourceSupportedResponseImpl implements CreateResourceSupportedResponse { + private CreateResourceSupportedResponseInner innerObject; + + private final com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager; + + CreateResourceSupportedResponseImpl( + CreateResourceSupportedResponseInner innerObject, + com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public CreateResourceSupportedProperties properties() { + return this.innerModel().properties(); + } + + public CreateResourceSupportedResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsClientImpl.java new file mode 100644 index 0000000000000..cb57ca577d588 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsClientImpl.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datadog.fluent.CreationSupportedsClient; +import com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner; +import com.azure.resourcemanager.datadog.models.CreateResourceSupportedResponseList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CreationSupportedsClient. */ +public final class CreationSupportedsClientImpl implements CreationSupportedsClient { + /** The proxy service used to perform REST calls. */ + private final CreationSupportedsService service; + + /** The service client containing this operation class. */ + private final MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of CreationSupportedsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CreationSupportedsClientImpl(MicrosoftDatadogClientImpl client) { + this.service = + RestProxy.create(CreationSupportedsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftDatadogClientCreationSupporteds to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftDatadogClie") + public interface CreationSupportedsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("datadogOrganizationId") String datadogOrganizationId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("datadogOrganizationId") String datadogOrganizationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String datadogOrganizationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (datadogOrganizationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter datadogOrganizationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + datadogOrganizationId, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String datadogOrganizationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (datadogOrganizationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter datadogOrganizationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + datadogOrganizationId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String datadogOrganizationId) { + return new PagedFlux<>(() -> listSinglePageAsync(datadogOrganizationId)); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String datadogOrganizationId, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(datadogOrganizationId, context)); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String datadogOrganizationId) { + return new PagedIterable<>(listAsync(datadogOrganizationId)); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String datadogOrganizationId, Context context) { + return new PagedIterable<>(listAsync(datadogOrganizationId, context)); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String datadogOrganizationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (datadogOrganizationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter datadogOrganizationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + datadogOrganizationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String datadogOrganizationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (datadogOrganizationId == null) { + return Mono + .error(new IllegalArgumentException("Parameter datadogOrganizationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + datadogOrganizationId, + accept, + context); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String datadogOrganizationId) { + return getWithResponseAsync(datadogOrganizationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String datadogOrganizationId, Context context) { + return getWithResponseAsync(datadogOrganizationId, context).block(); + } + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateResourceSupportedResponseInner get(String datadogOrganizationId) { + return getWithResponse(datadogOrganizationId, Context.NONE).getValue(); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsImpl.java new file mode 100644 index 0000000000000..e2dedba704962 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/CreationSupportedsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datadog.fluent.CreationSupportedsClient; +import com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner; +import com.azure.resourcemanager.datadog.models.CreateResourceSupportedResponse; +import com.azure.resourcemanager.datadog.models.CreationSupporteds; + +public final class CreationSupportedsImpl implements CreationSupporteds { + private static final ClientLogger LOGGER = new ClientLogger(CreationSupportedsImpl.class); + + private final CreationSupportedsClient innerClient; + + private final com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager; + + public CreationSupportedsImpl( + CreationSupportedsClient innerClient, + com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String datadogOrganizationId) { + PagedIterable inner = this.serviceClient().list(datadogOrganizationId); + return Utils.mapPage(inner, inner1 -> new CreateResourceSupportedResponseImpl(inner1, this.manager())); + } + + public PagedIterable list(String datadogOrganizationId, Context context) { + PagedIterable inner = + this.serviceClient().list(datadogOrganizationId, context); + return Utils.mapPage(inner, inner1 -> new CreateResourceSupportedResponseImpl(inner1, this.manager())); + } + + public Response getWithResponse(String datadogOrganizationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(datadogOrganizationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CreateResourceSupportedResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CreateResourceSupportedResponse get(String datadogOrganizationId) { + CreateResourceSupportedResponseInner inner = this.serviceClient().get(datadogOrganizationId); + if (inner != null) { + return new CreateResourceSupportedResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private CreationSupportedsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientBuilder.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientBuilder.java index 5598e6ae5f4d1..67adadd218d88 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientBuilder.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientBuilder.java @@ -137,7 +137,7 @@ public MicrosoftDatadogClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientImpl.java index 1942e55fe522c..653d55b3d7c01 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientImpl.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MicrosoftDatadogClientImpl.java @@ -22,8 +22,10 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.datadog.fluent.CreationSupportedsClient; import com.azure.resourcemanager.datadog.fluent.MarketplaceAgreementsClient; import com.azure.resourcemanager.datadog.fluent.MicrosoftDatadogClient; +import com.azure.resourcemanager.datadog.fluent.MonitoredSubscriptionsClient; import com.azure.resourcemanager.datadog.fluent.MonitorsClient; import com.azure.resourcemanager.datadog.fluent.OperationsClient; import com.azure.resourcemanager.datadog.fluent.SingleSignOnConfigurationsClient; @@ -124,6 +126,18 @@ public MarketplaceAgreementsClient getMarketplaceAgreements() { return this.marketplaceAgreements; } + /** The CreationSupportedsClient object to access its operations. */ + private final CreationSupportedsClient creationSupporteds; + + /** + * Gets the CreationSupportedsClient object to access its operations. + * + * @return the CreationSupportedsClient object. + */ + public CreationSupportedsClient getCreationSupporteds() { + return this.creationSupporteds; + } + /** The MonitorsClient object to access its operations. */ private final MonitorsClient monitors; @@ -172,6 +186,18 @@ public SingleSignOnConfigurationsClient getSingleSignOnConfigurations() { return this.singleSignOnConfigurations; } + /** The MonitoredSubscriptionsClient object to access its operations. */ + private final MonitoredSubscriptionsClient monitoredSubscriptions; + + /** + * Gets the MonitoredSubscriptionsClient object to access its operations. + * + * @return the MonitoredSubscriptionsClient object. + */ + public MonitoredSubscriptionsClient getMonitoredSubscriptions() { + return this.monitoredSubscriptions; + } + /** * Initializes an instance of MicrosoftDatadogClient client. * @@ -194,12 +220,14 @@ public SingleSignOnConfigurationsClient getSingleSignOnConfigurations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2023-01-01"; this.marketplaceAgreements = new MarketplaceAgreementsClientImpl(this); + this.creationSupporteds = new CreationSupportedsClientImpl(this); this.monitors = new MonitorsClientImpl(this); this.operations = new OperationsClientImpl(this); this.tagRules = new TagRulesClientImpl(this); this.singleSignOnConfigurations = new SingleSignOnConfigurationsClientImpl(this); + this.monitoredSubscriptions = new MonitoredSubscriptionsClientImpl(this); } /** diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionPropertiesImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionPropertiesImpl.java new file mode 100644 index 0000000000000..c5c226f21009e --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionPropertiesImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.datadog.models.SubscriptionList; + +public final class MonitoredSubscriptionPropertiesImpl + implements MonitoredSubscriptionProperties, + MonitoredSubscriptionProperties.Definition, + MonitoredSubscriptionProperties.Update { + private MonitoredSubscriptionPropertiesInner innerObject; + + private final com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubscriptionList properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MonitoredSubscriptionPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private String configurationName; + + public MonitoredSubscriptionPropertiesImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + public MonitoredSubscriptionProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitoredSubscriptions() + .createorUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public MonitoredSubscriptionProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitoredSubscriptions() + .createorUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), context); + return this; + } + + MonitoredSubscriptionPropertiesImpl( + String name, com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager) { + this.innerObject = new MonitoredSubscriptionPropertiesInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public MonitoredSubscriptionPropertiesImpl update() { + return this; + } + + public MonitoredSubscriptionProperties apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitoredSubscriptions() + .update(resourceGroupName, monitorName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public MonitoredSubscriptionProperties apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitoredSubscriptions() + .update(resourceGroupName, monitorName, configurationName, this.innerModel(), context); + return this; + } + + MonitoredSubscriptionPropertiesImpl( + MonitoredSubscriptionPropertiesInner innerObject, + com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + this.configurationName = Utils.getValueFromIdByName(innerObject.id(), "monitoredSubscriptions"); + } + + public MonitoredSubscriptionProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitoredSubscriptions() + .getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public MonitoredSubscriptionProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitoredSubscriptions() + .getWithResponse(resourceGroupName, monitorName, configurationName, context) + .getValue(); + return this; + } + + public MonitoredSubscriptionPropertiesImpl withProperties(SubscriptionList properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..cd1fa34c49e56 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsClientImpl.java @@ -0,0 +1,1483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datadog.fluent.MonitoredSubscriptionsClient; +import com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptionPropertiesList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MonitoredSubscriptionsClient. */ +public final class MonitoredSubscriptionsClientImpl implements MonitoredSubscriptionsClient { + /** The proxy service used to perform REST calls. */ + private final MonitoredSubscriptionsService service; + + /** The service client containing this operation class. */ + private final MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of MonitoredSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MonitoredSubscriptionsClientImpl(MicrosoftDatadogClientImpl client) { + this.service = + RestProxy + .create(MonitoredSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftDatadogClientMonitoredSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftDatadogClie") + public interface MonitoredSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("configurationName") String configurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createorUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("configurationName") String configurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("configurationName") String configurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("configurationName") String configurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName)); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, context)); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName)); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, context)); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String monitorName, String configurationName) { + return getWithResponseAsync(resourceGroupName, monitorName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, configurationName, context).block(); + } + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner get( + String resourceGroupName, String monitorName, String configurationName) { + return getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE).getValue(); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createorUpdateWithResponseAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createorUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createorUpdateWithResponseAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createorUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body) { + Mono>> mono = + createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, + this.client.getContext()); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdateAsync(String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + Mono>> mono = + createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, + this.client.getContext()); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, + context); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate(String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return this.beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).getSyncPoller(); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateorUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + return this + .beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context) + .getSyncPoller(); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createorUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body) { + return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createorUpdateAsync( + String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createorUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner createorUpdate( + String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return createorUpdateAsync(resourceGroupName, monitorName, configurationName, body).block(); + } + + /** + * Add the subscriptions that should be monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner createorUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + return createorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).block(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, + this.client.getContext()); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginUpdateAsync(String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, + this.client.getContext()); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoredSubscriptionPropertiesInner> + beginUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoredSubscriptionPropertiesInner.class, + MonitoredSubscriptionPropertiesInner.class, + context); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginUpdate(String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return this.beginUpdateAsync(resourceGroupName, monitorName, configurationName, body).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the + * Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + return this.beginUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body) { + return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner update( + String resourceGroupName, String monitorName, String configurationName) { + final MonitoredSubscriptionPropertiesInner body = null; + return updateAsync(resourceGroupName, monitorName, configurationName, body).block(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The request to update subscriptions needed to be monitored by the Datadog monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoredSubscriptionPropertiesInner update( + String resourceGroupName, + String monitorName, + String configurationName, + MonitoredSubscriptionPropertiesInner body, + Context context) { + return updateAsync(resourceGroupName, monitorName, configurationName, body, context).block(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, String configurationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, monitorName, configurationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, String configurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, monitorName, configurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String configurationName) { + return this.beginDeleteAsync(resourceGroupName, monitorName, configurationName).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String configurationName, Context context) { + return this.beginDeleteAsync(resourceGroupName, monitorName, configurationName, context).getSyncPoller(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, String configurationName) { + return beginDeleteAsync(resourceGroupName, monitorName, configurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String monitorName, String configurationName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, configurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, String configurationName) { + deleteAsync(resourceGroupName, monitorName, configurationName).block(); + } + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, String configurationName, Context context) { + deleteAsync(resourceGroupName, monitorName, configurationName, context).block(); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsImpl.java new file mode 100644 index 0000000000000..58a6d8ff3a36a --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitoredSubscriptionsImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datadog.fluent.MonitoredSubscriptionsClient; +import com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptionProperties; +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptions; + +public final class MonitoredSubscriptionsImpl implements MonitoredSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(MonitoredSubscriptionsImpl.class); + + private final MonitoredSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager; + + public MonitoredSubscriptionsImpl( + MonitoredSubscriptionsClient innerClient, + com.azure.resourcemanager.datadog.MicrosoftDatadogManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String monitorName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new MonitoredSubscriptionPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new MonitoredSubscriptionPropertiesImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, monitorName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MonitoredSubscriptionPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName, String configurationName) { + MonitoredSubscriptionPropertiesInner inner = + this.serviceClient().get(resourceGroupName, monitorName, configurationName); + if (inner != null) { + return new MonitoredSubscriptionPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String monitorName, String configurationName) { + this.serviceClient().delete(resourceGroupName, monitorName, configurationName); + } + + public void delete(String resourceGroupName, String monitorName, String configurationName, Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, configurationName, context); + } + + public MonitoredSubscriptionProperties getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", + id))); + } + return this.getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", + id))); + } + return this.getWithResponse(resourceGroupName, monitorName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", + id))); + } + this.delete(resourceGroupName, monitorName, configurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "monitoredSubscriptions"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'monitoredSubscriptions'.", + id))); + } + this.delete(resourceGroupName, monitorName, configurationName, context); + } + + private MonitoredSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager() { + return this.serviceManager; + } + + public MonitoredSubscriptionPropertiesImpl define(String name) { + return new MonitoredSubscriptionPropertiesImpl(name, this.manager()); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitorsClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitorsClientImpl.java index 9169f155dcb5a..f61635cf77107 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitorsClientImpl.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/MonitorsClientImpl.java @@ -77,8 +77,7 @@ public final class MonitorsClientImpl implements MonitorsClient { public interface MonitorsService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/listApiKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listApiKeys( @@ -92,8 +91,7 @@ Mono> listApiKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/getDefaultKey") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDefaultKey( @@ -107,8 +105,7 @@ Mono> getDefaultKey( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/setDefaultKey") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> setDefaultKey( @@ -123,8 +120,7 @@ Mono> setDefaultKey( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/listHosts") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listHosts( @@ -138,8 +134,7 @@ Mono> listHosts( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/listLinkedResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listLinkedResources( @@ -153,8 +148,7 @@ Mono> listLinkedResources( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/listMonitoredResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listMonitoredResources( @@ -191,8 +185,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -206,8 +199,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -222,8 +214,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -238,8 +229,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -253,8 +243,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/refreshSetPasswordLink") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> refreshSetPasswordLink( diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/OperationsClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/OperationsClientImpl.java index 356470e3240ad..a5a6866de5039 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/OperationsClientImpl.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/OperationsClientImpl.java @@ -78,7 +78,7 @@ Mono> listNext( } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -110,7 +110,7 @@ private Mono> listSinglePageAsync() { } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -143,7 +143,7 @@ private Mono> listSinglePageAsync(Context co } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -156,7 +156,7 @@ private PagedFlux listAsync() { } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -172,7 +172,7 @@ private PagedFlux listAsync(Context context) { } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -185,7 +185,7 @@ public PagedIterable list() { } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/SingleSignOnConfigurationsClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/SingleSignOnConfigurationsClientImpl.java index d124695d8bd89..7433db567892b 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/SingleSignOnConfigurationsClientImpl.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/SingleSignOnConfigurationsClientImpl.java @@ -67,8 +67,7 @@ public final class SingleSignOnConfigurationsClientImpl implements SingleSignOnC public interface SingleSignOnConfigurationsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/singleSignOnConfigurations") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -82,8 +81,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/singleSignOnConfigurations/{configurationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -99,8 +97,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/singleSignOnConfigurations/{configurationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/TagRulesClientImpl.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/TagRulesClientImpl.java index ca61f7c9d2c9d..8cc6124f135f9 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/TagRulesClientImpl.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/implementation/TagRulesClientImpl.java @@ -59,8 +59,7 @@ public final class TagRulesClientImpl implements TagRulesClient { public interface TagRulesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/tagRules") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -74,8 +73,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/tagRules/{ruleSetName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -91,8 +89,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" - + "/{monitorName}/tagRules/{ruleSetName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedProperties.java new file mode 100644 index 0000000000000..605f8da580f14 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Datadog resource can be created or not properties. */ +@Immutable +public final class CreateResourceSupportedProperties { + /* + * The ARM id of the subscription. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Indicates if selected subscription supports Datadog resource creation, if not it is already being monitored for + * the selected organization via multi subscription feature. + */ + @JsonProperty(value = "creationSupported", access = JsonProperty.Access.WRITE_ONLY) + private Boolean creationSupported; + + /** Creates an instance of CreateResourceSupportedProperties class. */ + public CreateResourceSupportedProperties() { + } + + /** + * Get the name property: The ARM id of the subscription. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the creationSupported property: Indicates if selected subscription supports Datadog resource creation, if not + * it is already being monitored for the selected organization via multi subscription feature. + * + * @return the creationSupported value. + */ + public Boolean creationSupported() { + return this.creationSupported; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponse.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponse.java new file mode 100644 index 0000000000000..748429fff252c --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner; + +/** An immutable client-side representation of CreateResourceSupportedResponse. */ +public interface CreateResourceSupportedResponse { + /** + * Gets the properties property: Represents the properties of the resource. + * + * @return the properties value. + */ + CreateResourceSupportedProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner object. + * + * @return the inner object. + */ + CreateResourceSupportedResponseInner innerModel(); +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponseList.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponseList.java new file mode 100644 index 0000000000000..8a3c0897b80b0 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreateResourceSupportedResponseList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datadog.fluent.models.CreateResourceSupportedResponseInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CreateResourceSupportedResponseList model. */ +@Fluent +public final class CreateResourceSupportedResponseList { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of CreateResourceSupportedResponseList class. */ + public CreateResourceSupportedResponseList() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the CreateResourceSupportedResponseList object itself. + */ + public CreateResourceSupportedResponseList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreationSupporteds.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreationSupporteds.java new file mode 100644 index 0000000000000..274775b72b71e --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/CreationSupporteds.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CreationSupporteds. */ +public interface CreationSupporteds { + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String datadogOrganizationId); + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String datadogOrganizationId, Context context); + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not along with {@link Response}. + */ + Response getWithResponse(String datadogOrganizationId, Context context); + + /** + * Informs if the current subscription is being already monitored for selected Datadog organization. + * + * @param datadogOrganizationId Datadog Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return datadog resource can be created or not. + */ + CreateResourceSupportedResponse get(String datadogOrganizationId); +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogHost.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogHost.java index 8c9645f328750..9fc88afc780b5 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogHost.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogHost.java @@ -17,7 +17,7 @@ public interface DatadogHost { String name(); /** - * Gets the aliases property: The aliases for the host. + * Gets the aliases property: The aliases for the host installed via the Datadog agent. * * @return the aliases value. */ diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogMonitorResource.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogMonitorResource.java index 81c38fdfb8d9f..a6b5e47708f3e 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogMonitorResource.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogMonitorResource.java @@ -113,11 +113,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The DatadogMonitorResource definition stages. */ interface DefinitionStages { /** The first stage of the DatadogMonitorResource definition. */ interface Blank extends WithLocation { } + /** The stage of the DatadogMonitorResource definition allowing to specify location. */ interface WithLocation { /** @@ -136,6 +138,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the DatadogMonitorResource definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -146,6 +149,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the DatadogMonitorResource definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -170,6 +174,7 @@ interface WithCreate */ DatadogMonitorResource create(Context context); } + /** The stage of the DatadogMonitorResource definition allowing to specify tags. */ interface WithTags { /** @@ -180,6 +185,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the DatadogMonitorResource definition allowing to specify sku. */ interface WithSku { /** @@ -190,6 +196,7 @@ interface WithSku { */ WithCreate withSku(ResourceSku sku); } + /** The stage of the DatadogMonitorResource definition allowing to specify properties. */ interface WithProperties { /** @@ -200,6 +207,7 @@ interface WithProperties { */ WithCreate withProperties(MonitorProperties properties); } + /** The stage of the DatadogMonitorResource definition allowing to specify identity. */ interface WithIdentity { /** @@ -211,6 +219,7 @@ interface WithIdentity { WithCreate withIdentity(IdentityProperties identity); } } + /** * Begins update for the DatadogMonitorResource resource. * @@ -235,6 +244,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, Upd */ DatadogMonitorResource apply(Context context); } + /** The DatadogMonitorResource update stages. */ interface UpdateStages { /** The stage of the DatadogMonitorResource update allowing to specify tags. */ @@ -247,6 +257,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the DatadogMonitorResource update allowing to specify properties. */ interface WithProperties { /** @@ -258,6 +269,7 @@ interface WithProperties { */ Update withProperties(MonitorUpdateProperties properties); } + /** The stage of the DatadogMonitorResource update allowing to specify sku. */ interface WithSku { /** @@ -269,6 +281,7 @@ interface WithSku { Update withSku(ResourceSku sku); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogOrganizationProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogOrganizationProperties.java index 7ec74f80fb88e..0c81a8b9ca0d5 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogOrganizationProperties.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogOrganizationProperties.java @@ -7,23 +7,26 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Datadog organization properties. */ +/** + * Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and + * Applicationkey is required as well. + */ @Fluent public final class DatadogOrganizationProperties { /* * Name of the Datadog organization. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "name") private String name; /* * Id of the Datadog organization. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "id") private String id; /* - * The auth code used to linking to an existing datadog organization. + * The auth code used to linking to an existing Datadog organization. */ @JsonProperty(value = "linkingAuthCode") private String linkingAuthCode; @@ -35,7 +38,7 @@ public final class DatadogOrganizationProperties { private String linkingClientId; /* - * The redirect uri for linking. + * The redirect URI for linking. */ @JsonProperty(value = "redirectUri") private String redirectUri; @@ -58,6 +61,13 @@ public final class DatadogOrganizationProperties { @JsonProperty(value = "enterpriseAppId") private 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. + */ + @JsonProperty(value = "cspm") + private Boolean cspm; + /** Creates an instance of DatadogOrganizationProperties class. */ public DatadogOrganizationProperties() { } @@ -71,6 +81,17 @@ public String name() { return this.name; } + /** + * Set the name property: Name of the Datadog organization. + * + * @param name the name value to set. + * @return the DatadogOrganizationProperties object itself. + */ + public DatadogOrganizationProperties withName(String name) { + this.name = name; + return this; + } + /** * Get the id property: Id of the Datadog organization. * @@ -81,7 +102,18 @@ public String id() { } /** - * Get the linkingAuthCode property: The auth code used to linking to an existing datadog organization. + * Set the id property: Id of the Datadog organization. + * + * @param id the id value to set. + * @return the DatadogOrganizationProperties object itself. + */ + public DatadogOrganizationProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the linkingAuthCode property: The auth code used to linking to an existing Datadog organization. * * @return the linkingAuthCode value. */ @@ -90,7 +122,7 @@ public String linkingAuthCode() { } /** - * Set the linkingAuthCode property: The auth code used to linking to an existing datadog organization. + * Set the linkingAuthCode property: The auth code used to linking to an existing Datadog organization. * * @param linkingAuthCode the linkingAuthCode value to set. * @return the DatadogOrganizationProperties object itself. @@ -123,7 +155,7 @@ public DatadogOrganizationProperties withLinkingClientId(String linkingClientId) } /** - * Get the redirectUri property: The redirect uri for linking. + * Get the redirectUri property: The redirect URI for linking. * * @return the redirectUri value. */ @@ -132,7 +164,7 @@ public String redirectUri() { } /** - * Set the redirectUri property: The redirect uri for linking. + * Set the redirectUri property: The redirect URI for linking. * * @param redirectUri the redirectUri value to set. * @return the DatadogOrganizationProperties object itself. @@ -202,6 +234,30 @@ public DatadogOrganizationProperties withEnterpriseAppId(String enterpriseAppId) return this; } + /** + * Get the cspm property: 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. + * + * @return the cspm value. + */ + public Boolean cspm() { + return this.cspm; + } + + /** + * Set the cspm property: 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. + * + * @param cspm the cspm value to set. + * @return the DatadogOrganizationProperties object itself. + */ + public DatadogOrganizationProperties withCspm(Boolean cspm) { + this.cspm = cspm; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogSingleSignOnResource.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogSingleSignOnResource.java index 671c41d15b206..a543cb5fcbf05 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogSingleSignOnResource.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/DatadogSingleSignOnResource.java @@ -63,11 +63,13 @@ public interface DatadogSingleSignOnResource { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The DatadogSingleSignOnResource definition stages. */ interface DefinitionStages { /** The first stage of the DatadogSingleSignOnResource definition. */ interface Blank extends WithParentResource { } + /** The stage of the DatadogSingleSignOnResource definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -79,6 +81,7 @@ interface WithParentResource { */ WithCreate withExistingMonitor(String resourceGroupName, String monitorName); } + /** * The stage of the DatadogSingleSignOnResource definition which contains all the minimum required properties * for the resource to be created, but also allows for any other optional properties to be specified. @@ -99,6 +102,7 @@ interface WithCreate extends DefinitionStages.WithProperties { */ DatadogSingleSignOnResource create(Context context); } + /** The stage of the DatadogSingleSignOnResource definition allowing to specify properties. */ interface WithProperties { /** @@ -110,6 +114,7 @@ interface WithProperties { WithCreate withProperties(DatadogSingleSignOnProperties properties); } } + /** * Begins update for the DatadogSingleSignOnResource resource. * @@ -134,6 +139,7 @@ interface Update extends UpdateStages.WithProperties { */ DatadogSingleSignOnResource apply(Context context); } + /** The DatadogSingleSignOnResource update stages. */ interface UpdateStages { /** The stage of the DatadogSingleSignOnResource update allowing to specify properties. */ @@ -147,6 +153,7 @@ interface WithProperties { Update withProperties(DatadogSingleSignOnProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/IdentityProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/IdentityProperties.java index adefe277e56d4..55524998b572b 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/IdentityProperties.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/IdentityProperties.java @@ -23,7 +23,7 @@ public final class IdentityProperties { private String tenantId; /* - * Identity type + * Specifies the identity type of the Datadog Monitor. At this time the only allowed value is 'SystemAssigned'. */ @JsonProperty(value = "type") private ManagedIdentityTypes type; @@ -51,7 +51,8 @@ public String tenantId() { } /** - * Get the type property: Identity type. + * Get the type property: Specifies the identity type of the Datadog Monitor. At this time the only allowed value is + * 'SystemAssigned'. * * @return the type value. */ @@ -60,7 +61,8 @@ public ManagedIdentityTypes type() { } /** - * Set the type property: Identity type. + * Set the type property: Specifies the identity type of the Datadog Monitor. At this time the only allowed value is + * 'SystemAssigned'. * * @param type the type value to set. * @return the IdentityProperties object itself. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ManagedIdentityTypes.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ManagedIdentityTypes.java index 27643fb1c7701..008e3b4a50c5a 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ManagedIdentityTypes.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ManagedIdentityTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Identity type. */ +/** Specifies the identity type of the Datadog Monitor. At this time the only allowed value is 'SystemAssigned'. */ public final class ManagedIdentityTypes extends ExpandableStringEnum { /** Static value SystemAssigned for ManagedIdentityTypes. */ public static final ManagedIdentityTypes SYSTEM_ASSIGNED = fromString("SystemAssigned"); diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorProperties.java index 78f02af192727..1059d85f4f38d 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorProperties.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorProperties.java @@ -30,13 +30,14 @@ public final class MonitorProperties { private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; /* - * Datadog organization properties + * Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and + * Applicationkey is required as well. */ @JsonProperty(value = "datadogOrganizationProperties") private DatadogOrganizationProperties datadogOrganizationProperties; /* - * User info + * Includes name, email and optionally, phone number. User Information can't be null. */ @JsonProperty(value = "userInfo") private UserInfo userInfo; @@ -97,7 +98,8 @@ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { } /** - * Get the datadogOrganizationProperties property: Datadog organization properties. + * Get the datadogOrganizationProperties property: Specify the Datadog organization name. In the case of linking to + * existing organizations, Id, ApiKey, and Applicationkey is required as well. * * @return the datadogOrganizationProperties value. */ @@ -106,7 +108,8 @@ public DatadogOrganizationProperties datadogOrganizationProperties() { } /** - * Set the datadogOrganizationProperties property: Datadog organization properties. + * Set the datadogOrganizationProperties property: Specify the Datadog organization name. In the case of linking to + * existing organizations, Id, ApiKey, and Applicationkey is required as well. * * @param datadogOrganizationProperties the datadogOrganizationProperties value to set. * @return the MonitorProperties object itself. @@ -118,7 +121,7 @@ public MonitorProperties withDatadogOrganizationProperties( } /** - * Get the userInfo property: User info. + * Get the userInfo property: Includes name, email and optionally, phone number. User Information can't be null. * * @return the userInfo value. */ @@ -127,7 +130,7 @@ public UserInfo userInfo() { } /** - * Set the userInfo property: User info. + * Set the userInfo property: Includes name, email and optionally, phone number. User Information can't be null. * * @param userInfo the userInfo value to set. * @return the MonitorProperties object itself. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorUpdateProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorUpdateProperties.java index d0bf7d05a886a..40721e3a6d0c8 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorUpdateProperties.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitorUpdateProperties.java @@ -16,6 +16,13 @@ public final class MonitorUpdateProperties { @JsonProperty(value = "monitoringStatus") private MonitoringStatus monitoringStatus; + /* + * 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. + */ + @JsonProperty(value = "cspm") + private Boolean cspm; + /** Creates an instance of MonitorUpdateProperties class. */ public MonitorUpdateProperties() { } @@ -40,6 +47,28 @@ public MonitorUpdateProperties withMonitoringStatus(MonitoringStatus monitoringS return this; } + /** + * Get the cspm property: 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. + * + * @return the cspm value. + */ + public Boolean cspm() { + return this.cspm; + } + + /** + * Set the cspm property: 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. + * + * @param cspm the cspm value to set. + * @return the MonitorUpdateProperties object itself. + */ + public MonitorUpdateProperties withCspm(Boolean cspm) { + this.cspm = cspm; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscription.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscription.java new file mode 100644 index 0000000000000..3ccf0b13156cc --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscription.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The list of subscriptions and it's monitoring status by current Datadog monitor. */ +@Fluent +public final class MonitoredSubscription { + /* + * The subscriptionId to be monitored. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * The state of monitoring. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * The reason of not monitoring the subscription. + */ + @JsonProperty(value = "error") + private String error; + + /* + * Definition of the properties for a TagRules resource. + */ + @JsonProperty(value = "tagRules") + private MonitoringTagRulesProperties tagRules; + + /** Creates an instance of MonitoredSubscription class. */ + public MonitoredSubscription() { + } + + /** + * Get the subscriptionId property: The subscriptionId to be monitored. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: The subscriptionId to be monitored. + * + * @param subscriptionId the subscriptionId value to set. + * @return the MonitoredSubscription object itself. + */ + public MonitoredSubscription withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the status property: The state of monitoring. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The state of monitoring. + * + * @param status the status value to set. + * @return the MonitoredSubscription object itself. + */ + public MonitoredSubscription withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the error property: The reason of not monitoring the subscription. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: The reason of not monitoring the subscription. + * + * @param error the error value to set. + * @return the MonitoredSubscription object itself. + */ + public MonitoredSubscription withError(String error) { + this.error = error; + return this; + } + + /** + * Get the tagRules property: Definition of the properties for a TagRules resource. + * + * @return the tagRules value. + */ + public MonitoringTagRulesProperties tagRules() { + return this.tagRules; + } + + /** + * Set the tagRules property: Definition of the properties for a TagRules resource. + * + * @param tagRules the tagRules value to set. + * @return the MonitoredSubscription object itself. + */ + public MonitoredSubscription withTagRules(MonitoringTagRulesProperties tagRules) { + this.tagRules = tagRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tagRules() != null) { + tagRules().validate(); + } + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionProperties.java new file mode 100644 index 0000000000000..16c0e9dba24cf --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner; + +/** An immutable client-side representation of MonitoredSubscriptionProperties. */ +public interface MonitoredSubscriptionProperties { + /** + * Gets the name property: Name of the monitored subscription resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The id of the monitored subscription resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the monitored subscription resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. + * + * @return the properties value. + */ + SubscriptionList properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner object. + * + * @return the inner object. + */ + MonitoredSubscriptionPropertiesInner innerModel(); + + /** The entirety of the MonitoredSubscriptionProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The MonitoredSubscriptionProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the MonitoredSubscriptionProperties definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the MonitoredSubscriptionProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @return the next definition stage. + */ + WithCreate withExistingMonitor(String resourceGroupName, String monitorName); + } + + /** + * The stage of the MonitoredSubscriptionProperties definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + MonitoredSubscriptionProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MonitoredSubscriptionProperties create(Context context); + } + + /** The stage of the MonitoredSubscriptionProperties definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The request to update subscriptions needed to be monitored by the + * Datadog monitor resource.. + * + * @param properties The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. + * @return the next definition stage. + */ + WithCreate withProperties(SubscriptionList properties); + } + } + + /** + * Begins update for the MonitoredSubscriptionProperties resource. + * + * @return the stage of resource update. + */ + MonitoredSubscriptionProperties.Update update(); + + /** The template for MonitoredSubscriptionProperties update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MonitoredSubscriptionProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MonitoredSubscriptionProperties apply(Context context); + } + + /** The MonitoredSubscriptionProperties update stages. */ + interface UpdateStages { + /** The stage of the MonitoredSubscriptionProperties update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The request to update subscriptions needed to be monitored by the + * Datadog monitor resource.. + * + * @param properties The request to update subscriptions needed to be monitored by the Datadog monitor + * resource. + * @return the next definition stage. + */ + Update withProperties(SubscriptionList properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MonitoredSubscriptionProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MonitoredSubscriptionProperties refresh(Context context); +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionPropertiesList.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionPropertiesList.java new file mode 100644 index 0000000000000..a315e5e07d26c --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptionPropertiesList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datadog.fluent.models.MonitoredSubscriptionPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The MonitoredSubscriptionPropertiesList model. */ +@Fluent +public final class MonitoredSubscriptionPropertiesList { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of MonitoredSubscriptionPropertiesList class. */ + public MonitoredSubscriptionPropertiesList() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the MonitoredSubscriptionPropertiesList object itself. + */ + public MonitoredSubscriptionPropertiesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptions.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptions.java new file mode 100644 index 0000000000000..b9ea46c2bcacb --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoredSubscriptions.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MonitoredSubscriptions. */ +public interface MonitoredSubscriptions { + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName, Context context); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName The configuration name. Only 'default' value is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource. + */ + MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName, String configurationName); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, String configurationName); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, String configurationName, Context context); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response}. + */ + MonitoredSubscriptionProperties getById(String id); + + /** + * List the subscriptions currently being monitored by the Datadog monitor resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the request to update subscriptions needed to be monitored by the Datadog monitor resource along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Updates the subscriptions that are being monitored by the Datadog monitor resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MonitoredSubscriptionProperties resource. + * + * @param name resource name. + * @return the first stage of the new MonitoredSubscriptionProperties definition. + */ + MonitoredSubscriptionProperties.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRules.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRules.java index ae719b2fb5dfb..0801842716501 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRules.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRules.java @@ -63,11 +63,13 @@ public interface MonitoringTagRules { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The MonitoringTagRules definition stages. */ interface DefinitionStages { /** The first stage of the MonitoringTagRules definition. */ interface Blank extends WithParentResource { } + /** The stage of the MonitoringTagRules definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -79,6 +81,7 @@ interface WithParentResource { */ WithCreate withExistingMonitor(String resourceGroupName, String monitorName); } + /** * The stage of the MonitoringTagRules definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. @@ -99,6 +102,7 @@ interface WithCreate extends DefinitionStages.WithProperties { */ MonitoringTagRules create(Context context); } + /** The stage of the MonitoringTagRules definition allowing to specify properties. */ interface WithProperties { /** @@ -110,6 +114,7 @@ interface WithProperties { WithCreate withProperties(MonitoringTagRulesProperties properties); } } + /** * Begins update for the MonitoringTagRules resource. * @@ -134,6 +139,7 @@ interface Update extends UpdateStages.WithProperties { */ MonitoringTagRules apply(Context context); } + /** The MonitoringTagRules update stages. */ interface UpdateStages { /** The stage of the MonitoringTagRules update allowing to specify properties. */ @@ -147,6 +153,7 @@ interface WithProperties { Update withProperties(MonitoringTagRulesProperties properties); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRulesProperties.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRulesProperties.java index 621c8e55987b6..278bbdd56bb73 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRulesProperties.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/MonitoringTagRulesProperties.java @@ -28,6 +28,12 @@ public final class MonitoringTagRulesProperties { @JsonProperty(value = "metricRules") private MetricRules metricRules; + /* + * Configuration to enable/disable auto-muting flag + */ + @JsonProperty(value = "automuting") + private Boolean automuting; + /** Creates an instance of MonitoringTagRulesProperties class. */ public MonitoringTagRulesProperties() { } @@ -81,6 +87,26 @@ public MonitoringTagRulesProperties withMetricRules(MetricRules metricRules) { return this; } + /** + * Get the automuting property: Configuration to enable/disable auto-muting flag. + * + * @return the automuting value. + */ + public Boolean automuting() { + return this.automuting; + } + + /** + * Set the automuting property: Configuration to enable/disable auto-muting flag. + * + * @param automuting the automuting value to set. + * @return the MonitoringTagRulesProperties object itself. + */ + public MonitoringTagRulesProperties withAutomuting(Boolean automuting) { + this.automuting = automuting; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operation.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operation.java new file mode 100644 index 0000000000000..1dc14f2e3ba40 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The operation for the patch on the resource. */ +public final class Operation extends ExpandableStringEnum { + /** Static value AddBegin for Operation. */ + public static final Operation ADD_BEGIN = fromString("AddBegin"); + + /** Static value AddComplete for Operation. */ + public static final Operation ADD_COMPLETE = fromString("AddComplete"); + + /** Static value DeleteBegin for Operation. */ + public static final Operation DELETE_BEGIN = fromString("DeleteBegin"); + + /** Static value DeleteComplete for Operation. */ + public static final Operation DELETE_COMPLETE = fromString("DeleteComplete"); + + /** Static value Active for Operation. */ + public static final Operation ACTIVE = fromString("Active"); + + /** + * Creates a new instance of Operation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Operation() { + } + + /** + * Creates or finds a Operation from its string representation. + * + * @param name a name to look for. + * @return the corresponding Operation. + */ + @JsonCreator + public static Operation fromString(String name) { + return fromString(name, Operation.class); + } + + /** + * Gets known Operation values. + * + * @return known Operation values. + */ + public static Collection values() { + return values(Operation.class); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operations.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operations.java index f3c7c6d601ec6..06632b7ce987b 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operations.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Operations.java @@ -10,7 +10,7 @@ /** Resource collection API of Operations. */ public interface Operations { /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -20,7 +20,7 @@ public interface Operations { PagedIterable list(); /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ResourceSku.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ResourceSku.java index 93ea1f3ca516f..e63a7f7f73b20 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ResourceSku.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/ResourceSku.java @@ -12,7 +12,7 @@ @Fluent public final class ResourceSku { /* - * Name of the SKU. + * Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. */ @JsonProperty(value = "name", required = true) private String name; @@ -22,7 +22,7 @@ public ResourceSku() { } /** - * Get the name property: Name of the SKU. + * Get the name property: Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. * * @return the name value. */ @@ -31,7 +31,7 @@ public String name() { } /** - * Set the name property: Name of the SKU. + * Set the name property: Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. * * @param name the name value to set. * @return the ResourceSku object itself. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Status.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Status.java new file mode 100644 index 0000000000000..3bebd2c763515 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/Status.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The state of monitoring. */ +public final class Status extends ExpandableStringEnum { + /** Static value InProgress for Status. */ + public static final Status IN_PROGRESS = fromString("InProgress"); + + /** Static value Active for Status. */ + public static final Status ACTIVE = fromString("Active"); + + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); + + /** Static value Deleting for Status. */ + public static final Status DELETING = fromString("Deleting"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/SubscriptionList.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/SubscriptionList.java new file mode 100644 index 0000000000000..2cd757d6200dd --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/SubscriptionList.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The request to update subscriptions needed to be monitored by the Datadog monitor resource. */ +@Fluent +public final class SubscriptionList { + /* + * The operation for the patch on the resource. + */ + @JsonProperty(value = "operation") + private Operation operation; + + /* + * List of subscriptions and the state of the monitoring. + */ + @JsonProperty(value = "monitoredSubscriptionList") + private List monitoredSubscriptionList; + + /** Creates an instance of SubscriptionList class. */ + public SubscriptionList() { + } + + /** + * Get the operation property: The operation for the patch on the resource. + * + * @return the operation value. + */ + public Operation operation() { + return this.operation; + } + + /** + * Set the operation property: The operation for the patch on the resource. + * + * @param operation the operation value to set. + * @return the SubscriptionList object itself. + */ + public SubscriptionList withOperation(Operation operation) { + this.operation = operation; + return this; + } + + /** + * Get the monitoredSubscriptionList property: List of subscriptions and the state of the monitoring. + * + * @return the monitoredSubscriptionList value. + */ + public List monitoredSubscriptionList() { + return this.monitoredSubscriptionList; + } + + /** + * Set the monitoredSubscriptionList property: List of subscriptions and the state of the monitoring. + * + * @param monitoredSubscriptionList the monitoredSubscriptionList value to set. + * @return the SubscriptionList object itself. + */ + public SubscriptionList withMonitoredSubscriptionList(List monitoredSubscriptionList) { + this.monitoredSubscriptionList = monitoredSubscriptionList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (monitoredSubscriptionList() != null) { + monitoredSubscriptionList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/UserInfo.java b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/UserInfo.java index baac357eacb08..c3dc79d981ad1 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/UserInfo.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/main/java/com/azure/resourcemanager/datadog/models/UserInfo.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** User info. */ +/** Includes name, email and optionally, phone number. User Information can't be null. */ @Fluent public final class UserInfo { /* diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedGetSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedGetSamples.java new file mode 100644 index 0000000000000..eb9cacb7b10b2 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +/** Samples for CreationSupported Get. */ +public final class CreationSupportedGetSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/CreationSupported_Get.json + */ + /** + * Sample code: CreationSupported_Get. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void creationSupportedGet(com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.creationSupporteds().getWithResponse("00000000-0000-0000-0000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedListSamples.java new file mode 100644 index 0000000000000..014d292395fdf --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/CreationSupportedListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +/** Samples for CreationSupported List. */ +public final class CreationSupportedListSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/CreationSupported_List.json + */ + /** + * Sample code: CreationSupported_List. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void creationSupportedList(com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.creationSupporteds().list("00000000-0000-0000-0000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateSamples.java index fe2e67f086055..076eff7231e4c 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateSamples.java @@ -7,7 +7,7 @@ /** Samples for MarketplaceAgreements CreateOrUpdate. */ public final class MarketplaceAgreementsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_Create.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MarketplaceAgreements_Create.json */ /** * Sample code: MarketplaceAgreements_CreateOrUpdate. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListSamples.java index da77beeb3e41c..5d86a315b3232 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListSamples.java @@ -7,7 +7,7 @@ /** Samples for MarketplaceAgreements List. */ public final class MarketplaceAgreementsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MarketplaceAgreements_List.json */ /** * Sample code: MarketplaceAgreements_List. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsCreateorUpdateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsCreateorUpdateSamples.java new file mode 100644 index 0000000000000..e0b3cf85824fe --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsCreateorUpdateSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +/** Samples for MonitoredSubscriptions CreateorUpdate. */ +public final class MonitoredSubscriptionsCreateorUpdateSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_CreateorUpdate.json + */ + /** + * Sample code: Monitors_AddMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsAddMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.monitoredSubscriptions().define("default").withExistingMonitor("myResourceGroup", "myMonitor").create(); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsDeleteSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsDeleteSamples.java new file mode 100644 index 0000000000000..273715d0b4e12 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +/** Samples for MonitoredSubscriptions Delete. */ +public final class MonitoredSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_Delete.json + */ + /** + * Sample code: Monitors_DeleteMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsDeleteMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager + .monitoredSubscriptions() + .delete("myResourceGroup", "myMonitor", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsGetSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsGetSamples.java new file mode 100644 index 0000000000000..15d79be19017b --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +/** Samples for MonitoredSubscriptions Get. */ +public final class MonitoredSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_Get.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager + .monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsListSamples.java new file mode 100644 index 0000000000000..9e5aef7c0a5c8 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +/** Samples for MonitoredSubscriptions List. */ +public final class MonitoredSubscriptionsListSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_List.json + */ + /** + * Sample code: Monitors_GetMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsGetMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + manager.monitoredSubscriptions().list("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsUpdateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsUpdateSamples.java new file mode 100644 index 0000000000000..abd3116251057 --- /dev/null +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitoredSubscriptionsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datadog.generated; + +import com.azure.resourcemanager.datadog.models.MonitoredSubscriptionProperties; + +/** Samples for MonitoredSubscriptions Update. */ +public final class MonitoredSubscriptionsUpdateSamples { + /* + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredSubscriptions_Update.json + */ + /** + * Sample code: Monitors_UpdateMonitoredSubscriptions. + * + * @param manager Entry point to MicrosoftDatadogManager. + */ + public static void monitorsUpdateMonitoredSubscriptions( + com.azure.resourcemanager.datadog.MicrosoftDatadogManager manager) { + MonitoredSubscriptionProperties resource = + manager + .monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsCreateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsCreateSamples.java index 7c90eb2d5da4e..0d0b37126152f 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsCreateSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors Create. */ public final class MonitorsCreateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Create.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Create.json */ /** * Sample code: Monitors_Create. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteSamples.java index f8edd27845f4b..dd53e80b7967d 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors Delete. */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Delete.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Delete.json */ /** * Sample code: Monitors_Delete. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetByResourceGroupSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetByResourceGroupSamples.java index 6fde4641b2add..f52676194e7f6 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetByResourceGroupSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors GetByResourceGroup. */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Get.json */ /** * Sample code: Monitors_Get. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetDefaultKeySamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetDefaultKeySamples.java index d4a4ba0b53533..3031bb4dda353 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetDefaultKeySamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsGetDefaultKeySamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors GetDefaultKey. */ public final class MonitorsGetDefaultKeySamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_GetDefaultKey.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/ApiKeys_GetDefaultKey.json */ /** * Sample code: Monitors_GetDefaultKey. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListApiKeysSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListApiKeysSamples.java index 8a51caf78c45f..e000af5f030ae 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListApiKeysSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListApiKeysSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListApiKeys. */ public final class MonitorsListApiKeysSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/ApiKeys_List.json */ /** * Sample code: Monitors_ListApiKeys. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListByResourceGroupSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListByResourceGroupSamples.java index 7a144d490b685..0dd8b86096804 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListByResourceGroupSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListByResourceGroup. */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_ListByResourceGroup.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_ListByResourceGroup.json */ /** * Sample code: Monitors_ListByResourceGroup. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsSamples.java index 929990ef5a9dc..3578d077e7f08 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListHosts. */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Hosts_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Hosts_List.json */ /** * Sample code: Monitors_ListHosts. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesSamples.java index 57e7ab155a8f8..eaf67cb2700d3 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListLinkedResources. */ public final class MonitorsListLinkedResourcesSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/LinkedResources_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/LinkedResources_List.json */ /** * Sample code: Monitors_ListLinkedResources. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesSamples.java index f5990bf0e4c37..8b3783a1bd9fe 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors ListMonitoredResources. */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MonitoredResources_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/MonitoredResources_List.json */ /** * Sample code: Monitors_ListMonitoredResources. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListSamples.java index 09585e14ae94c..31e983363b0ba 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors List. */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_List.json */ /** * Sample code: Monitors_List. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsRefreshSetPasswordLinkSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsRefreshSetPasswordLinkSamples.java index 460664695a8da..fa89ac1df079f 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsRefreshSetPasswordLinkSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsRefreshSetPasswordLinkSamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors RefreshSetPasswordLink. */ public final class MonitorsRefreshSetPasswordLinkSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/RefreshSetPassword_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/RefreshSetPassword_Get.json */ /** * Sample code: Monitors_RefreshSetPasswordLink. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsSetDefaultKeySamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsSetDefaultKeySamples.java index 8a3a08af14873..2f6811cd1eb5b 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsSetDefaultKeySamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsSetDefaultKeySamples.java @@ -7,7 +7,7 @@ /** Samples for Monitors SetDefaultKey. */ public final class MonitorsSetDefaultKeySamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_SetDefaultKey.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/ApiKeys_SetDefaultKey.json */ /** * Sample code: Monitors_SetDefaultKey. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsUpdateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsUpdateSamples.java index e8568c431207c..62fb975948999 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsUpdateSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/MonitorsUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for Monitors Update. */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Update.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Monitors_Update.json */ /** * Sample code: Monitors_Update. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/OperationsListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/OperationsListSamples.java index 55318b8cfa1c0..cec55723f8edc 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/OperationsListSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Operations_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateSamples.java index 9d88da2d071ca..7cc73bd25c4dc 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateSamples.java @@ -7,7 +7,7 @@ /** Samples for SingleSignOnConfigurations CreateOrUpdate. */ public final class SingleSignOnConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json */ /** * Sample code: SingleSignOnConfigurations_CreateOrUpdate. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetSamples.java index 356fa214d4468..2f198e34a0662 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for SingleSignOnConfigurations Get. */ public final class SingleSignOnConfigurationsGetSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/SingleSignOnConfigurations_Get.json */ /** * Sample code: SingleSignOnConfigurations_Get. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListSamples.java index f5db756308ebe..d3768b6d0e508 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for SingleSignOnConfigurations List. */ public final class SingleSignOnConfigurationsListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/SingleSignOnConfigurations_List.json */ /** * Sample code: SingleSignOnConfigurations_List. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateSamples.java index 6d8a0e43932e6..8f32219ad0e98 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateSamples.java @@ -7,7 +7,7 @@ /** Samples for TagRules CreateOrUpdate. */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_CreateOrUpdate.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/TagRules_CreateOrUpdate.json */ /** * Sample code: TagRules_CreateOrUpdate. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesGetSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesGetSamples.java index 71843ae6f20c8..91d566b61e5c0 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesGetSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for TagRules Get. */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/TagRules_Get.json */ /** * Sample code: TagRules_Get. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesListSamples.java b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesListSamples.java index 5856e808aa317..2053c3b5ba409 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesListSamples.java +++ b/sdk/datadog/azure-resourcemanager-datadog/src/samples/java/com/azure/resourcemanager/datadog/generated/TagRulesListSamples.java @@ -7,7 +7,7 @@ /** Samples for TagRules List. */ public final class TagRulesListSamples { /* - * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_List.json + * x-ms-original-file: specification/datadog/resource-manager/Microsoft.Datadog/stable/2023-01-01/examples/TagRules_List.json */ /** * Sample code: TagRules_List. diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementPropertiesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementPropertiesTests.java deleted file mode 100644 index 9853efea5a223..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementPropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.DatadogAgreementProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class DatadogAgreementPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogAgreementProperties model = - BinaryData - .fromString( - "{\"publisher\":\"b\",\"product\":\"rkxvdum\",\"plan\":\"rtfw\",\"licenseTextLink\":\"k\",\"privacyPolicyLink\":\"audccsnhs\",\"retrieveDatetime\":\"2021-10-29T04:44:12Z\",\"signature\":\"ejhkry\",\"accepted\":true}") - .toObject(DatadogAgreementProperties.class); - Assertions.assertEquals("b", model.publisher()); - Assertions.assertEquals("rkxvdum", model.product()); - Assertions.assertEquals("rtfw", model.plan()); - Assertions.assertEquals("k", model.licenseTextLink()); - Assertions.assertEquals("audccsnhs", model.privacyPolicyLink()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T04:44:12Z"), model.retrieveDatetime()); - Assertions.assertEquals("ejhkry", model.signature()); - Assertions.assertEquals(true, model.accepted()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogAgreementProperties model = - new DatadogAgreementProperties() - .withPublisher("b") - .withProduct("rkxvdum") - .withPlan("rtfw") - .withLicenseTextLink("k") - .withPrivacyPolicyLink("audccsnhs") - .withRetrieveDatetime(OffsetDateTime.parse("2021-10-29T04:44:12Z")) - .withSignature("ejhkry") - .withAccepted(true); - model = BinaryData.fromObject(model).toObject(DatadogAgreementProperties.class); - Assertions.assertEquals("b", model.publisher()); - Assertions.assertEquals("rkxvdum", model.product()); - Assertions.assertEquals("rtfw", model.plan()); - Assertions.assertEquals("k", model.licenseTextLink()); - Assertions.assertEquals("audccsnhs", model.privacyPolicyLink()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T04:44:12Z"), model.retrieveDatetime()); - Assertions.assertEquals("ejhkry", model.signature()); - Assertions.assertEquals(true, model.accepted()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceInnerTests.java deleted file mode 100644 index 806c64bb90ef4..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogAgreementResourceInner; -import com.azure.resourcemanager.datadog.models.DatadogAgreementProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class DatadogAgreementResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogAgreementResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"publisher\":\"u\",\"product\":\"nryrtihf\",\"plan\":\"ijbpzvgnwzsymgl\",\"licenseTextLink\":\"fcyzkohdbihanufh\",\"privacyPolicyLink\":\"bj\",\"retrieveDatetime\":\"2021-10-05T18:31:22Z\",\"signature\":\"ithxqhabifpi\",\"accepted\":false},\"id\":\"zb\",\"name\":\"scnpqxuhivy\",\"type\":\"n\"}") - .toObject(DatadogAgreementResourceInner.class); - Assertions.assertEquals("u", model.properties().publisher()); - Assertions.assertEquals("nryrtihf", model.properties().product()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.properties().plan()); - Assertions.assertEquals("fcyzkohdbihanufh", model.properties().licenseTextLink()); - Assertions.assertEquals("bj", model.properties().privacyPolicyLink()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T18:31:22Z"), model.properties().retrieveDatetime()); - Assertions.assertEquals("ithxqhabifpi", model.properties().signature()); - Assertions.assertEquals(false, model.properties().accepted()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogAgreementResourceInner model = - new DatadogAgreementResourceInner() - .withProperties( - new DatadogAgreementProperties() - .withPublisher("u") - .withProduct("nryrtihf") - .withPlan("ijbpzvgnwzsymgl") - .withLicenseTextLink("fcyzkohdbihanufh") - .withPrivacyPolicyLink("bj") - .withRetrieveDatetime(OffsetDateTime.parse("2021-10-05T18:31:22Z")) - .withSignature("ithxqhabifpi") - .withAccepted(false)); - model = BinaryData.fromObject(model).toObject(DatadogAgreementResourceInner.class); - Assertions.assertEquals("u", model.properties().publisher()); - Assertions.assertEquals("nryrtihf", model.properties().product()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.properties().plan()); - Assertions.assertEquals("fcyzkohdbihanufh", model.properties().licenseTextLink()); - Assertions.assertEquals("bj", model.properties().privacyPolicyLink()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T18:31:22Z"), model.properties().retrieveDatetime()); - Assertions.assertEquals("ithxqhabifpi", model.properties().signature()); - Assertions.assertEquals(false, model.properties().accepted()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceListResponseTests.java deleted file mode 100644 index 5618ed3300a7e..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogAgreementResourceListResponseTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogAgreementResourceInner; -import com.azure.resourcemanager.datadog.models.DatadogAgreementProperties; -import com.azure.resourcemanager.datadog.models.DatadogAgreementResourceListResponse; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatadogAgreementResourceListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogAgreementResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"publisher\":\"uv\",\"product\":\"xpyb\",\"plan\":\"m\",\"licenseTextLink\":\"mtz\",\"privacyPolicyLink\":\"bsphrupidgsybbe\",\"retrieveDatetime\":\"2021-02-20T13:53:07Z\",\"signature\":\"oycmsxaobhdxbmt\",\"accepted\":true},\"id\":\"jzehtb\",\"name\":\"ufpo\",\"type\":\"noi\"},{\"properties\":{\"publisher\":\"lrxybqsoq\",\"product\":\"gkdmb\",\"plan\":\"zlobcufpd\",\"licenseTextLink\":\"rbt\",\"privacyPolicyLink\":\"qjnqglhqgnufoooj\",\"retrieveDatetime\":\"2021-06-05T07:25:28Z\",\"signature\":\"sqe\",\"accepted\":true},\"id\":\"dfmglzlhjx\",\"name\":\"ifkwmrvktsizntoc\",\"type\":\"pa\"},{\"properties\":{\"publisher\":\"jpsq\",\"product\":\"mpoyfd\",\"plan\":\"ogknygjofjdd\",\"licenseTextLink\":\"s\",\"privacyPolicyLink\":\"eupewnwreitjz\",\"retrieveDatetime\":\"2021-09-21T22:26:17Z\",\"signature\":\"sarhmofc\",\"accepted\":false},\"id\":\"yurkdtmlxhekuksj\",\"name\":\"xukcdmpar\",\"type\":\"ryuanzwuxzdxtay\"}],\"nextLink\":\"hmwhfpmrqo\"}") - .toObject(DatadogAgreementResourceListResponse.class); - Assertions.assertEquals("uv", model.value().get(0).properties().publisher()); - Assertions.assertEquals("xpyb", model.value().get(0).properties().product()); - Assertions.assertEquals("m", model.value().get(0).properties().plan()); - Assertions.assertEquals("mtz", model.value().get(0).properties().licenseTextLink()); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).properties().privacyPolicyLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-02-20T13:53:07Z"), model.value().get(0).properties().retrieveDatetime()); - Assertions.assertEquals("oycmsxaobhdxbmt", model.value().get(0).properties().signature()); - Assertions.assertEquals(true, model.value().get(0).properties().accepted()); - Assertions.assertEquals("hmwhfpmrqo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogAgreementResourceListResponse model = - new DatadogAgreementResourceListResponse() - .withValue( - Arrays - .asList( - new DatadogAgreementResourceInner() - .withProperties( - new DatadogAgreementProperties() - .withPublisher("uv") - .withProduct("xpyb") - .withPlan("m") - .withLicenseTextLink("mtz") - .withPrivacyPolicyLink("bsphrupidgsybbe") - .withRetrieveDatetime(OffsetDateTime.parse("2021-02-20T13:53:07Z")) - .withSignature("oycmsxaobhdxbmt") - .withAccepted(true)), - new DatadogAgreementResourceInner() - .withProperties( - new DatadogAgreementProperties() - .withPublisher("lrxybqsoq") - .withProduct("gkdmb") - .withPlan("zlobcufpd") - .withLicenseTextLink("rbt") - .withPrivacyPolicyLink("qjnqglhqgnufoooj") - .withRetrieveDatetime(OffsetDateTime.parse("2021-06-05T07:25:28Z")) - .withSignature("sqe") - .withAccepted(true)), - new DatadogAgreementResourceInner() - .withProperties( - new DatadogAgreementProperties() - .withPublisher("jpsq") - .withProduct("mpoyfd") - .withPlan("ogknygjofjdd") - .withLicenseTextLink("s") - .withPrivacyPolicyLink("eupewnwreitjz") - .withRetrieveDatetime(OffsetDateTime.parse("2021-09-21T22:26:17Z")) - .withSignature("sarhmofc") - .withAccepted(false)))) - .withNextLink("hmwhfpmrqo"); - model = BinaryData.fromObject(model).toObject(DatadogAgreementResourceListResponse.class); - Assertions.assertEquals("uv", model.value().get(0).properties().publisher()); - Assertions.assertEquals("xpyb", model.value().get(0).properties().product()); - Assertions.assertEquals("m", model.value().get(0).properties().plan()); - Assertions.assertEquals("mtz", model.value().get(0).properties().licenseTextLink()); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).properties().privacyPolicyLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-02-20T13:53:07Z"), model.value().get(0).properties().retrieveDatetime()); - Assertions.assertEquals("oycmsxaobhdxbmt", model.value().get(0).properties().signature()); - Assertions.assertEquals(true, model.value().get(0).properties().accepted()); - Assertions.assertEquals("hmwhfpmrqo", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostInnerTests.java deleted file mode 100644 index bb7ef0213e51f..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogHostInner; -import com.azure.resourcemanager.datadog.models.DatadogHostMetadata; -import com.azure.resourcemanager.datadog.models.DatadogInstallMethod; -import com.azure.resourcemanager.datadog.models.DatadogLogsAgent; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatadogHostInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogHostInner model = - BinaryData - .fromString( - "{\"name\":\"jaeq\",\"aliases\":[\"jbasvmsmjqulngs\",\"tnb\"],\"apps\":[\"zgcwrw\",\"lxxwrljdouskc\",\"vkocrcjdkwtn\"],\"meta\":{\"agentVersion\":\"njbiksqrglssain\",\"installMethod\":{\"tool\":\"wnzlljfmppeeb\",\"toolVersion\":\"gxsabkyq\",\"installerVersion\":\"ujitcjcz\"},\"logsAgent\":{\"transport\":\"vndhkrwpdapp\"}}}") - .toObject(DatadogHostInner.class); - Assertions.assertEquals("jaeq", model.name()); - Assertions.assertEquals("jbasvmsmjqulngs", model.aliases().get(0)); - Assertions.assertEquals("zgcwrw", model.apps().get(0)); - Assertions.assertEquals("njbiksqrglssain", model.meta().agentVersion()); - Assertions.assertEquals("wnzlljfmppeeb", model.meta().installMethod().tool()); - Assertions.assertEquals("gxsabkyq", model.meta().installMethod().toolVersion()); - Assertions.assertEquals("ujitcjcz", model.meta().installMethod().installerVersion()); - Assertions.assertEquals("vndhkrwpdapp", model.meta().logsAgent().transport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogHostInner model = - new DatadogHostInner() - .withName("jaeq") - .withAliases(Arrays.asList("jbasvmsmjqulngs", "tnb")) - .withApps(Arrays.asList("zgcwrw", "lxxwrljdouskc", "vkocrcjdkwtn")) - .withMeta( - new DatadogHostMetadata() - .withAgentVersion("njbiksqrglssain") - .withInstallMethod( - new DatadogInstallMethod() - .withTool("wnzlljfmppeeb") - .withToolVersion("gxsabkyq") - .withInstallerVersion("ujitcjcz")) - .withLogsAgent(new DatadogLogsAgent().withTransport("vndhkrwpdapp"))); - model = BinaryData.fromObject(model).toObject(DatadogHostInner.class); - Assertions.assertEquals("jaeq", model.name()); - Assertions.assertEquals("jbasvmsmjqulngs", model.aliases().get(0)); - Assertions.assertEquals("zgcwrw", model.apps().get(0)); - Assertions.assertEquals("njbiksqrglssain", model.meta().agentVersion()); - Assertions.assertEquals("wnzlljfmppeeb", model.meta().installMethod().tool()); - Assertions.assertEquals("gxsabkyq", model.meta().installMethod().toolVersion()); - Assertions.assertEquals("ujitcjcz", model.meta().installMethod().installerVersion()); - Assertions.assertEquals("vndhkrwpdapp", model.meta().logsAgent().transport()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostListResponseTests.java deleted file mode 100644 index 9859914bcdafa..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostListResponseTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogHostInner; -import com.azure.resourcemanager.datadog.models.DatadogHostListResponse; -import com.azure.resourcemanager.datadog.models.DatadogHostMetadata; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatadogHostListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogHostListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"ahuxinpm\",\"aliases\":[\"aqwi\",\"jsprozvcpute\",\"jvwmfda\"],\"apps\":[\"mdvpjhulsu\"],\"meta\":{\"agentVersion\":\"kjozkrwfnd\"}},{\"name\":\"pslwejdpvw\",\"aliases\":[\"qpsoacctazak\",\"j\"],\"apps\":[\"bcryffdfd\",\"sy\",\"expa\",\"jakhmsbzjh\"],\"meta\":{\"agentVersion\":\"evdphlxaol\"}},{\"name\":\"rgqjbpfzfsinzg\",\"aliases\":[\"jrwzox\",\"j\",\"felluwfzitonpe\",\"fpjkjlxofp\"],\"apps\":[\"pfxxy\"],\"meta\":{\"agentVersion\":\"i\"}},{\"name\":\"huyb\",\"aliases\":[\"odepoogin\",\"vamih\"],\"apps\":[\"narxzxtheotus\",\"vyevcciqi\",\"nhungbw\"],\"meta\":{\"agentVersion\":\"nfygxgispemvtz\"}}],\"nextLink\":\"ubljofxqe\"}") - .toObject(DatadogHostListResponse.class); - Assertions.assertEquals("ahuxinpm", model.value().get(0).name()); - Assertions.assertEquals("aqwi", model.value().get(0).aliases().get(0)); - Assertions.assertEquals("mdvpjhulsu", model.value().get(0).apps().get(0)); - Assertions.assertEquals("kjozkrwfnd", model.value().get(0).meta().agentVersion()); - Assertions.assertEquals("ubljofxqe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogHostListResponse model = - new DatadogHostListResponse() - .withValue( - Arrays - .asList( - new DatadogHostInner() - .withName("ahuxinpm") - .withAliases(Arrays.asList("aqwi", "jsprozvcpute", "jvwmfda")) - .withApps(Arrays.asList("mdvpjhulsu")) - .withMeta(new DatadogHostMetadata().withAgentVersion("kjozkrwfnd")), - new DatadogHostInner() - .withName("pslwejdpvw") - .withAliases(Arrays.asList("qpsoacctazak", "j")) - .withApps(Arrays.asList("bcryffdfd", "sy", "expa", "jakhmsbzjh")) - .withMeta(new DatadogHostMetadata().withAgentVersion("evdphlxaol")), - new DatadogHostInner() - .withName("rgqjbpfzfsinzg") - .withAliases(Arrays.asList("jrwzox", "j", "felluwfzitonpe", "fpjkjlxofp")) - .withApps(Arrays.asList("pfxxy")) - .withMeta(new DatadogHostMetadata().withAgentVersion("i")), - new DatadogHostInner() - .withName("huyb") - .withAliases(Arrays.asList("odepoogin", "vamih")) - .withApps(Arrays.asList("narxzxtheotus", "vyevcciqi", "nhungbw")) - .withMeta(new DatadogHostMetadata().withAgentVersion("nfygxgispemvtz")))) - .withNextLink("ubljofxqe"); - model = BinaryData.fromObject(model).toObject(DatadogHostListResponse.class); - Assertions.assertEquals("ahuxinpm", model.value().get(0).name()); - Assertions.assertEquals("aqwi", model.value().get(0).aliases().get(0)); - Assertions.assertEquals("mdvpjhulsu", model.value().get(0).apps().get(0)); - Assertions.assertEquals("kjozkrwfnd", model.value().get(0).meta().agentVersion()); - Assertions.assertEquals("ubljofxqe", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostMetadataTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostMetadataTests.java deleted file mode 100644 index 7b6018e83ae89..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogHostMetadataTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.DatadogHostMetadata; -import com.azure.resourcemanager.datadog.models.DatadogInstallMethod; -import com.azure.resourcemanager.datadog.models.DatadogLogsAgent; -import org.junit.jupiter.api.Assertions; - -public final class DatadogHostMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogHostMetadata model = - BinaryData - .fromString( - "{\"agentVersion\":\"bdkvwrwjf\",\"installMethod\":{\"tool\":\"nhutjeltmrldhugj\",\"toolVersion\":\"datqxhocdgeabl\",\"installerVersion\":\"huticndvkao\"},\"logsAgent\":{\"transport\":\"i\"}}") - .toObject(DatadogHostMetadata.class); - Assertions.assertEquals("bdkvwrwjf", model.agentVersion()); - Assertions.assertEquals("nhutjeltmrldhugj", model.installMethod().tool()); - Assertions.assertEquals("datqxhocdgeabl", model.installMethod().toolVersion()); - Assertions.assertEquals("huticndvkao", model.installMethod().installerVersion()); - Assertions.assertEquals("i", model.logsAgent().transport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogHostMetadata model = - new DatadogHostMetadata() - .withAgentVersion("bdkvwrwjf") - .withInstallMethod( - new DatadogInstallMethod() - .withTool("nhutjeltmrldhugj") - .withToolVersion("datqxhocdgeabl") - .withInstallerVersion("huticndvkao")) - .withLogsAgent(new DatadogLogsAgent().withTransport("i")); - model = BinaryData.fromObject(model).toObject(DatadogHostMetadata.class); - Assertions.assertEquals("bdkvwrwjf", model.agentVersion()); - Assertions.assertEquals("nhutjeltmrldhugj", model.installMethod().tool()); - Assertions.assertEquals("datqxhocdgeabl", model.installMethod().toolVersion()); - Assertions.assertEquals("huticndvkao", model.installMethod().installerVersion()); - Assertions.assertEquals("i", model.logsAgent().transport()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogInstallMethodTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogInstallMethodTests.java deleted file mode 100644 index 5abd81a8f08b2..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogInstallMethodTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.DatadogInstallMethod; -import org.junit.jupiter.api.Assertions; - -public final class DatadogInstallMethodTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogInstallMethod model = - BinaryData - .fromString("{\"tool\":\"yhxhu\",\"toolVersion\":\"k\",\"installerVersion\":\"yxolniwp\"}") - .toObject(DatadogInstallMethod.class); - Assertions.assertEquals("yhxhu", model.tool()); - Assertions.assertEquals("k", model.toolVersion()); - Assertions.assertEquals("yxolniwp", model.installerVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogInstallMethod model = - new DatadogInstallMethod().withTool("yhxhu").withToolVersion("k").withInstallerVersion("yxolniwp"); - model = BinaryData.fromObject(model).toObject(DatadogInstallMethod.class); - Assertions.assertEquals("yhxhu", model.tool()); - Assertions.assertEquals("k", model.toolVersion()); - Assertions.assertEquals("yxolniwp", model.installerVersion()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogLogsAgentTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogLogsAgentTests.java deleted file mode 100644 index db82697e73797..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogLogsAgentTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.DatadogLogsAgent; -import org.junit.jupiter.api.Assertions; - -public final class DatadogLogsAgentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogLogsAgent model = - BinaryData.fromString("{\"transport\":\"ukjfkgiawxklr\"}").toObject(DatadogLogsAgent.class); - Assertions.assertEquals("ukjfkgiawxklr", model.transport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogLogsAgent model = new DatadogLogsAgent().withTransport("ukjfkgiawxklr"); - model = BinaryData.fromObject(model).toObject(DatadogLogsAgent.class); - Assertions.assertEquals("ukjfkgiawxklr", model.transport()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceListResponseTests.java deleted file mode 100644 index a5da573511333..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceListResponseTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogMonitorResourceInner; -import com.azure.resourcemanager.datadog.models.DatadogMonitorResourceListResponse; -import com.azure.resourcemanager.datadog.models.IdentityProperties; -import com.azure.resourcemanager.datadog.models.ManagedIdentityTypes; -import com.azure.resourcemanager.datadog.models.MonitorProperties; -import com.azure.resourcemanager.datadog.models.MonitoringStatus; -import com.azure.resourcemanager.datadog.models.ResourceSku; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DatadogMonitorResourceListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogMonitorResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"sku\":{\"name\":\"rhhbcs\"},\"properties\":{\"provisioningState\":\"Deleting\",\"monitoringStatus\":\"Enabled\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":1555681942},\"identity\":{\"principalId\":\"bdxkqpxokaj\",\"tenantId\":\"npime\",\"type\":\"SystemAssigned\"},\"location\":\"xgcp\",\"tags\":{\"mcl\":\"maajrmvdjwzrlo\",\"jctbza\":\"hijco\"},\"id\":\"s\",\"name\":\"sycbkbfk\",\"type\":\"ukdkexxppofmxa\"},{\"sku\":{\"name\":\"fjpgddtocjjxhvp\"},\"properties\":{\"provisioningState\":\"NotSpecified\",\"monitoringStatus\":\"Enabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":427127517},\"identity\":{\"principalId\":\"xqbzvddntwnd\",\"tenantId\":\"cbtwnpzaoqvuh\",\"type\":\"UserAssigned\"},\"location\":\"fcyddg\",\"tags\":{\"jqkwpyeicx\":\"t\",\"pbobjo\":\"qciwqvhkhixuigdt\",\"w\":\"hm\"},\"id\":\"a\",\"name\":\"a\",\"type\":\"hrzayvvtpgvdf\"},{\"sku\":{\"name\":\"otkftutqxlngx\"},\"properties\":{\"provisioningState\":\"Failed\",\"monitoringStatus\":\"Disabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"liftrResourceCategory\":\"Unknown\",\"liftrResourcePreference\":435751453},\"identity\":{\"principalId\":\"tthzrvqd\",\"tenantId\":\"bhj\",\"type\":\"SystemAssigned\"},\"location\":\"ehoqfbowskan\",\"tags\":{\"nhzgpphrcgyn\":\"zlcuiywgqywgndrv\",\"fsxlzevgbmqjqa\":\"ocpecfvmmco\",\"pmivkwlzu\":\"c\",\"ebxetqgtzxdp\":\"ccfwnfnbacfion\"},\"id\":\"qbqqwxr\",\"name\":\"feallnwsu\",\"type\":\"isnjampmngnz\"},{\"sku\":{\"name\":\"xaqwoochcbonqv\"},\"properties\":{\"provisioningState\":\"Accepted\",\"monitoringStatus\":\"Enabled\",\"marketplaceSubscriptionStatus\":\"Active\",\"liftrResourceCategory\":\"MonitorLogs\",\"liftrResourcePreference\":625674029},\"identity\":{\"principalId\":\"oflokey\",\"tenantId\":\"enjbdlwtgrhp\",\"type\":\"SystemAssigned\"},\"location\":\"umasxazjpq\",\"tags\":{\"zvdudgwdslfhotwm\":\"ualhbxxhejj\"},\"id\":\"ynpwlbj\",\"name\":\"pgacftadehxnlty\",\"type\":\"sop\"}],\"nextLink\":\"suesnzw\"}") - .toObject(DatadogMonitorResourceListResponse.class); - Assertions.assertEquals("xgcp", model.value().get(0).location()); - Assertions.assertEquals("maajrmvdjwzrlo", model.value().get(0).tags().get("mcl")); - Assertions.assertEquals("rhhbcs", model.value().get(0).sku().name()); - Assertions.assertEquals(MonitoringStatus.ENABLED, model.value().get(0).properties().monitoringStatus()); - Assertions.assertEquals(ManagedIdentityTypes.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("suesnzw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogMonitorResourceListResponse model = - new DatadogMonitorResourceListResponse() - .withValue( - Arrays - .asList( - new DatadogMonitorResourceInner() - .withLocation("xgcp") - .withTags(mapOf("mcl", "maajrmvdjwzrlo", "jctbza", "hijco")) - .withSku(new ResourceSku().withName("rhhbcs")) - .withProperties(new MonitorProperties().withMonitoringStatus(MonitoringStatus.ENABLED)) - .withIdentity(new IdentityProperties().withType(ManagedIdentityTypes.SYSTEM_ASSIGNED)), - new DatadogMonitorResourceInner() - .withLocation("fcyddg") - .withTags(mapOf("jqkwpyeicx", "t", "pbobjo", "qciwqvhkhixuigdt", "w", "hm")) - .withSku(new ResourceSku().withName("fjpgddtocjjxhvp")) - .withProperties(new MonitorProperties().withMonitoringStatus(MonitoringStatus.ENABLED)) - .withIdentity(new IdentityProperties().withType(ManagedIdentityTypes.USER_ASSIGNED)), - new DatadogMonitorResourceInner() - .withLocation("ehoqfbowskan") - .withTags( - mapOf( - "nhzgpphrcgyn", - "zlcuiywgqywgndrv", - "fsxlzevgbmqjqa", - "ocpecfvmmco", - "pmivkwlzu", - "c", - "ebxetqgtzxdp", - "ccfwnfnbacfion")) - .withSku(new ResourceSku().withName("otkftutqxlngx")) - .withProperties(new MonitorProperties().withMonitoringStatus(MonitoringStatus.DISABLED)) - .withIdentity(new IdentityProperties().withType(ManagedIdentityTypes.SYSTEM_ASSIGNED)), - new DatadogMonitorResourceInner() - .withLocation("umasxazjpq") - .withTags(mapOf("zvdudgwdslfhotwm", "ualhbxxhejj")) - .withSku(new ResourceSku().withName("xaqwoochcbonqv")) - .withProperties(new MonitorProperties().withMonitoringStatus(MonitoringStatus.ENABLED)) - .withIdentity(new IdentityProperties().withType(ManagedIdentityTypes.SYSTEM_ASSIGNED)))) - .withNextLink("suesnzw"); - model = BinaryData.fromObject(model).toObject(DatadogMonitorResourceListResponse.class); - Assertions.assertEquals("xgcp", model.value().get(0).location()); - Assertions.assertEquals("maajrmvdjwzrlo", model.value().get(0).tags().get("mcl")); - Assertions.assertEquals("rhhbcs", model.value().get(0).sku().name()); - Assertions.assertEquals(MonitoringStatus.ENABLED, model.value().get(0).properties().monitoringStatus()); - Assertions.assertEquals(ManagedIdentityTypes.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("suesnzw", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceUpdateParametersTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceUpdateParametersTests.java deleted file mode 100644 index b2db5ba5f769e..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogMonitorResourceUpdateParametersTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.DatadogMonitorResourceUpdateParameters; -import com.azure.resourcemanager.datadog.models.MonitorUpdateProperties; -import com.azure.resourcemanager.datadog.models.MonitoringStatus; -import com.azure.resourcemanager.datadog.models.ResourceSku; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DatadogMonitorResourceUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogMonitorResourceUpdateParameters model = - BinaryData - .fromString( - "{\"properties\":{\"monitoringStatus\":\"Disabled\"},\"tags\":{\"vxodpu\":\"fcp\",\"axbezyiuo\":\"zmyzydagf\",\"dxwzywqsmbsurexi\":\"ktwh\",\"yocf\":\"o\"},\"sku\":{\"name\":\"ksymd\"}}") - .toObject(DatadogMonitorResourceUpdateParameters.class); - Assertions.assertEquals(MonitoringStatus.DISABLED, model.properties().monitoringStatus()); - Assertions.assertEquals("fcp", model.tags().get("vxodpu")); - Assertions.assertEquals("ksymd", model.sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogMonitorResourceUpdateParameters model = - new DatadogMonitorResourceUpdateParameters() - .withProperties(new MonitorUpdateProperties().withMonitoringStatus(MonitoringStatus.DISABLED)) - .withTags(mapOf("vxodpu", "fcp", "axbezyiuo", "zmyzydagf", "dxwzywqsmbsurexi", "ktwh", "yocf", "o")) - .withSku(new ResourceSku().withName("ksymd")); - model = BinaryData.fromObject(model).toObject(DatadogMonitorResourceUpdateParameters.class); - Assertions.assertEquals(MonitoringStatus.DISABLED, model.properties().monitoringStatus()); - Assertions.assertEquals("fcp", model.tags().get("vxodpu")); - Assertions.assertEquals("ksymd", model.sku().name()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnPropertiesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnPropertiesTests.java deleted file mode 100644 index 6ff7fb84513f5..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnProperties; -import com.azure.resourcemanager.datadog.models.SingleSignOnStates; -import org.junit.jupiter.api.Assertions; - -public final class DatadogSingleSignOnPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogSingleSignOnProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Deleting\",\"singleSignOnState\":\"Disable\",\"enterpriseAppId\":\"iarbutrcvpna\",\"singleSignOnUrl\":\"mhjrunmpxttdbhr\"}") - .toObject(DatadogSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.DISABLE, model.singleSignOnState()); - Assertions.assertEquals("iarbutrcvpna", model.enterpriseAppId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogSingleSignOnProperties model = - new DatadogSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.DISABLE) - .withEnterpriseAppId("iarbutrcvpna"); - model = BinaryData.fromObject(model).toObject(DatadogSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.DISABLE, model.singleSignOnState()); - Assertions.assertEquals("iarbutrcvpna", model.enterpriseAppId()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceInnerTests.java deleted file mode 100644 index 8ae938fe3faca..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogSingleSignOnResourceInner; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnProperties; -import com.azure.resourcemanager.datadog.models.SingleSignOnStates; -import org.junit.jupiter.api.Assertions; - -public final class DatadogSingleSignOnResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogSingleSignOnResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"zlfbxzpuzycispnq\",\"singleSignOnUrl\":\"hmgkbrpyy\"},\"id\":\"ibnuqqkpik\",\"name\":\"drgvtqagn\",\"type\":\"uynhijg\"}") - .toObject(DatadogSingleSignOnResourceInner.class); - Assertions.assertEquals(SingleSignOnStates.INITIAL, model.properties().singleSignOnState()); - Assertions.assertEquals("zlfbxzpuzycispnq", model.properties().enterpriseAppId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogSingleSignOnResourceInner model = - new DatadogSingleSignOnResourceInner() - .withProperties( - new DatadogSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL) - .withEnterpriseAppId("zlfbxzpuzycispnq")); - model = BinaryData.fromObject(model).toObject(DatadogSingleSignOnResourceInner.class); - Assertions.assertEquals(SingleSignOnStates.INITIAL, model.properties().singleSignOnState()); - Assertions.assertEquals("zlfbxzpuzycispnq", model.properties().enterpriseAppId()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceListResponseTests.java deleted file mode 100644 index 2424f3ba85dec..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/DatadogSingleSignOnResourceListResponseTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.DatadogSingleSignOnResourceInner; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnProperties; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnResourceListResponse; -import com.azure.resourcemanager.datadog.models.SingleSignOnStates; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatadogSingleSignOnResourceListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatadogSingleSignOnResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"singleSignOnState\":\"Disable\",\"enterpriseAppId\":\"zpwv\",\"singleSignOnUrl\":\"dqgbiqylihkaetc\"},\"id\":\"vfcivfsnkymuc\",\"name\":\"qhjfbebr\",\"type\":\"cxerf\"},{\"properties\":{\"provisioningState\":\"Updating\",\"singleSignOnState\":\"Disable\",\"enterpriseAppId\":\"fvjrbirphxepcy\",\"singleSignOnUrl\":\"hfnljkyq\"},\"id\":\"vuujq\",\"name\":\"idokgjlj\",\"type\":\"oxgvclt\"},{\"properties\":{\"provisioningState\":\"Deleted\",\"singleSignOnState\":\"Disable\",\"enterpriseAppId\":\"kjeszz\",\"singleSignOnUrl\":\"ijhtxf\"},\"id\":\"xbf\",\"name\":\"mxnehmp\",\"type\":\"ec\"}],\"nextLink\":\"odebfqkkrbmpu\"}") - .toObject(DatadogSingleSignOnResourceListResponse.class); - Assertions.assertEquals(SingleSignOnStates.DISABLE, model.value().get(0).properties().singleSignOnState()); - Assertions.assertEquals("zpwv", model.value().get(0).properties().enterpriseAppId()); - Assertions.assertEquals("odebfqkkrbmpu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatadogSingleSignOnResourceListResponse model = - new DatadogSingleSignOnResourceListResponse() - .withValue( - Arrays - .asList( - new DatadogSingleSignOnResourceInner() - .withProperties( - new DatadogSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.DISABLE) - .withEnterpriseAppId("zpwv")), - new DatadogSingleSignOnResourceInner() - .withProperties( - new DatadogSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.DISABLE) - .withEnterpriseAppId("fvjrbirphxepcy")), - new DatadogSingleSignOnResourceInner() - .withProperties( - new DatadogSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.DISABLE) - .withEnterpriseAppId("kjeszz")))) - .withNextLink("odebfqkkrbmpu"); - model = BinaryData.fromObject(model).toObject(DatadogSingleSignOnResourceListResponse.class); - Assertions.assertEquals(SingleSignOnStates.DISABLE, model.value().get(0).properties().singleSignOnState()); - Assertions.assertEquals("zpwv", model.value().get(0).properties().enterpriseAppId()); - Assertions.assertEquals("odebfqkkrbmpu", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/FilteringTagTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/FilteringTagTests.java deleted file mode 100644 index 2ba83c255d6bf..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/FilteringTagTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.FilteringTag; -import com.azure.resourcemanager.datadog.models.TagAction; -import org.junit.jupiter.api.Assertions; - -public final class FilteringTagTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FilteringTag model = - BinaryData - .fromString("{\"name\":\"w\",\"value\":\"eun\",\"action\":\"Exclude\"}") - .toObject(FilteringTag.class); - Assertions.assertEquals("w", model.name()); - Assertions.assertEquals("eun", model.value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FilteringTag model = new FilteringTag().withName("w").withValue("eun").withAction(TagAction.EXCLUDE); - model = BinaryData.fromObject(model).toObject(FilteringTag.class); - Assertions.assertEquals("w", model.name()); - Assertions.assertEquals("eun", model.value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.action()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/IdentityPropertiesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/IdentityPropertiesTests.java deleted file mode 100644 index 70884455f4a5a..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/IdentityPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.IdentityProperties; -import com.azure.resourcemanager.datadog.models.ManagedIdentityTypes; -import org.junit.jupiter.api.Assertions; - -public final class IdentityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityProperties model = - BinaryData - .fromString("{\"principalId\":\"fhyhltrpmopjmcma\",\"tenantId\":\"okth\",\"type\":\"SystemAssigned\"}") - .toObject(IdentityProperties.class); - Assertions.assertEquals(ManagedIdentityTypes.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityProperties model = new IdentityProperties().withType(ManagedIdentityTypes.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(IdentityProperties.class); - Assertions.assertEquals(ManagedIdentityTypes.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceInnerTests.java deleted file mode 100644 index 49e000106351c..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.LinkedResourceInner; -import org.junit.jupiter.api.Assertions; - -public final class LinkedResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedResourceInner model = BinaryData.fromString("{\"id\":\"gakeqsr\"}").toObject(LinkedResourceInner.class); - Assertions.assertEquals("gakeqsr", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedResourceInner model = new LinkedResourceInner().withId("gakeqsr"); - model = BinaryData.fromObject(model).toObject(LinkedResourceInner.class); - Assertions.assertEquals("gakeqsr", model.id()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceListResponseTests.java deleted file mode 100644 index 685cf384bc5e1..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LinkedResourceListResponseTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.LinkedResourceInner; -import com.azure.resourcemanager.datadog.models.LinkedResourceListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LinkedResourceListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LinkedResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"ckbasyypndd\"},{\"id\":\"gcbacphejkot\"},{\"id\":\"qgoulznd\"},{\"id\":\"kwy\"}],\"nextLink\":\"gfgibm\"}") - .toObject(LinkedResourceListResponse.class); - Assertions.assertEquals("ckbasyypndd", model.value().get(0).id()); - Assertions.assertEquals("gfgibm", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LinkedResourceListResponse model = - new LinkedResourceListResponse() - .withValue( - Arrays - .asList( - new LinkedResourceInner().withId("ckbasyypndd"), - new LinkedResourceInner().withId("gcbacphejkot"), - new LinkedResourceInner().withId("qgoulznd"), - new LinkedResourceInner().withId("kwy"))) - .withNextLink("gfgibm"); - model = BinaryData.fromObject(model).toObject(LinkedResourceListResponse.class); - Assertions.assertEquals("ckbasyypndd", model.value().get(0).id()); - Assertions.assertEquals("gfgibm", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LogRulesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LogRulesTests.java deleted file mode 100644 index 6e923c4ecfed8..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/LogRulesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.FilteringTag; -import com.azure.resourcemanager.datadog.models.LogRules; -import com.azure.resourcemanager.datadog.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LogRulesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogRules model = - BinaryData - .fromString( - "{\"sendAadLogs\":false,\"sendSubscriptionLogs\":false,\"sendResourceLogs\":true,\"filteringTags\":[{\"name\":\"tiyqzrnkcqv\",\"value\":\"lwh\",\"action\":\"Exclude\"},{\"name\":\"cohoq\",\"value\":\"wvl\",\"action\":\"Exclude\"}]}") - .toObject(LogRules.class); - Assertions.assertEquals(false, model.sendAadLogs()); - Assertions.assertEquals(false, model.sendSubscriptionLogs()); - Assertions.assertEquals(true, model.sendResourceLogs()); - Assertions.assertEquals("tiyqzrnkcqv", model.filteringTags().get(0).name()); - Assertions.assertEquals("lwh", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogRules model = - new LogRules() - .withSendAadLogs(false) - .withSendSubscriptionLogs(false) - .withSendResourceLogs(true) - .withFilteringTags( - Arrays - .asList( - new FilteringTag().withName("tiyqzrnkcqv").withValue("lwh").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("cohoq").withValue("wvl").withAction(TagAction.EXCLUDE))); - model = BinaryData.fromObject(model).toObject(LogRules.class); - Assertions.assertEquals(false, model.sendAadLogs()); - Assertions.assertEquals(false, model.sendSubscriptionLogs()); - Assertions.assertEquals(true, model.sendResourceLogs()); - Assertions.assertEquals("tiyqzrnkcqv", model.filteringTags().get(0).name()); - Assertions.assertEquals("lwh", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateWithResponseMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 73f2e0b9a9d16..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.fluent.models.DatadogAgreementResourceInner; -import com.azure.resourcemanager.datadog.models.DatadogAgreementProperties; -import com.azure.resourcemanager.datadog.models.DatadogAgreementResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MarketplaceAgreementsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publisher\":\"vgyuguos\",\"product\":\"kfssxqukkf\",\"plan\":\"gmgsxnkjzkde\",\"licenseTextLink\":\"pvlopwiyighxpkd\",\"privacyPolicyLink\":\"baiuebbaumny\",\"retrieveDatetime\":\"2021-02-11T09:41:28Z\",\"signature\":\"deoj\",\"accepted\":true},\"id\":\"khsmtxpsiebt\",\"name\":\"hvpesapskrdqm\",\"type\":\"jjdhtld\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatadogAgreementResource response = - manager - .marketplaceAgreements() - .createOrUpdateWithResponse( - new DatadogAgreementResourceInner() - .withProperties( - new DatadogAgreementProperties() - .withPublisher("ckzywbiexzfeyue") - .withProduct("ibx") - .withPlan("wbhqwal") - .withLicenseTextLink("zyoxaepdkzjan") - .withPrivacyPolicyLink("xrhdwbavxbniwdjs") - .withRetrieveDatetime(OffsetDateTime.parse("2021-12-07T05:36:29Z")) - .withSignature("dbpgnxytxhp") - .withAccepted(false)), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vgyuguos", response.properties().publisher()); - Assertions.assertEquals("kfssxqukkf", response.properties().product()); - Assertions.assertEquals("gmgsxnkjzkde", response.properties().plan()); - Assertions.assertEquals("pvlopwiyighxpkd", response.properties().licenseTextLink()); - Assertions.assertEquals("baiuebbaumny", response.properties().privacyPolicyLink()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T09:41:28Z"), response.properties().retrieveDatetime()); - Assertions.assertEquals("deoj", response.properties().signature()); - Assertions.assertEquals(true, response.properties().accepted()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListMockTests.java deleted file mode 100644 index 63aee10c96f12..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MarketplaceAgreementsListMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.DatadogAgreementResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MarketplaceAgreementsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"publisher\":\"ankxmyskpbhenb\",\"product\":\"cxy\",\"plan\":\"y\",\"licenseTextLink\":\"rsyn\",\"privacyPolicyLink\":\"idybyxczf\",\"retrieveDatetime\":\"2021-02-02T08:06:37Z\",\"signature\":\"axdbabph\",\"accepted\":true},\"id\":\"lfktsths\",\"name\":\"cocmnyyaztt\",\"type\":\"twwrqp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.marketplaceAgreements().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ankxmyskpbhenb", response.iterator().next().properties().publisher()); - Assertions.assertEquals("cxy", response.iterator().next().properties().product()); - Assertions.assertEquals("y", response.iterator().next().properties().plan()); - Assertions.assertEquals("rsyn", response.iterator().next().properties().licenseTextLink()); - Assertions.assertEquals("idybyxczf", response.iterator().next().properties().privacyPolicyLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-02-02T08:06:37Z"), - response.iterator().next().properties().retrieveDatetime()); - Assertions.assertEquals("axdbabph", response.iterator().next().properties().signature()); - Assertions.assertEquals(true, response.iterator().next().properties().accepted()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MetricRulesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MetricRulesTests.java deleted file mode 100644 index acbb38bf04565..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MetricRulesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.FilteringTag; -import com.azure.resourcemanager.datadog.models.MetricRules; -import com.azure.resourcemanager.datadog.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricRulesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricRules model = - BinaryData - .fromString( - "{\"filteringTags\":[{\"name\":\"xzko\",\"value\":\"cukoklyaxuconu\",\"action\":\"Include\"},{\"name\":\"kbeype\",\"value\":\"mjmwvvjektcx\",\"action\":\"Exclude\"}]}") - .toObject(MetricRules.class); - Assertions.assertEquals("xzko", model.filteringTags().get(0).name()); - Assertions.assertEquals("cukoklyaxuconu", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricRules model = - new MetricRules() - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("xzko") - .withValue("cukoklyaxuconu") - .withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("kbeype") - .withValue("mjmwvvjektcx") - .withAction(TagAction.EXCLUDE))); - model = BinaryData.fromObject(model).toObject(MetricRules.class); - Assertions.assertEquals("xzko", model.filteringTags().get(0).name()); - Assertions.assertEquals("cukoklyaxuconu", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorUpdatePropertiesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorUpdatePropertiesTests.java deleted file mode 100644 index 5dc9ab96d30f8..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorUpdatePropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.MonitorUpdateProperties; -import com.azure.resourcemanager.datadog.models.MonitoringStatus; -import org.junit.jupiter.api.Assertions; - -public final class MonitorUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitorUpdateProperties model = - BinaryData.fromString("{\"monitoringStatus\":\"Disabled\"}").toObject(MonitorUpdateProperties.class); - Assertions.assertEquals(MonitoringStatus.DISABLED, model.monitoringStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitorUpdateProperties model = new MonitorUpdateProperties().withMonitoringStatus(MonitoringStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(MonitorUpdateProperties.class); - Assertions.assertEquals(MonitoringStatus.DISABLED, model.monitoringStatus()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceInnerTests.java deleted file mode 100644 index cc3b88661f347..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.MonitoredResourceInner; -import org.junit.jupiter.api.Assertions; - -public final class MonitoredResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoredResourceInner model = - BinaryData - .fromString( - "{\"id\":\"uvfqawrlyxwj\",\"sendingMetrics\":true,\"reasonForMetricsStatus\":\"bnwbxgjvtbvpyssz\",\"sendingLogs\":false,\"reasonForLogsStatus\":\"jq\"}") - .toObject(MonitoredResourceInner.class); - Assertions.assertEquals("uvfqawrlyxwj", model.id()); - Assertions.assertEquals(true, model.sendingMetrics()); - Assertions.assertEquals("bnwbxgjvtbvpyssz", model.reasonForMetricsStatus()); - Assertions.assertEquals(false, model.sendingLogs()); - Assertions.assertEquals("jq", model.reasonForLogsStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoredResourceInner model = - new MonitoredResourceInner() - .withId("uvfqawrlyxwj") - .withSendingMetrics(true) - .withReasonForMetricsStatus("bnwbxgjvtbvpyssz") - .withSendingLogs(false) - .withReasonForLogsStatus("jq"); - model = BinaryData.fromObject(model).toObject(MonitoredResourceInner.class); - Assertions.assertEquals("uvfqawrlyxwj", model.id()); - Assertions.assertEquals(true, model.sendingMetrics()); - Assertions.assertEquals("bnwbxgjvtbvpyssz", model.reasonForMetricsStatus()); - Assertions.assertEquals(false, model.sendingLogs()); - Assertions.assertEquals("jq", model.reasonForLogsStatus()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceListResponseTests.java deleted file mode 100644 index 98a8c3692c716..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoredResourceListResponseTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.MonitoredResourceInner; -import com.azure.resourcemanager.datadog.models.MonitoredResourceListResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitoredResourceListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoredResourceListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"qqedqytbciqfou\",\"sendingMetrics\":true,\"reasonForMetricsStatus\":\"nkzsmodmglou\",\"sendingLogs\":false,\"reasonForLogsStatus\":\"wtmutduq\"},{\"id\":\"ap\",\"sendingMetrics\":false,\"reasonForMetricsStatus\":\"cuertu\",\"sendingLogs\":true,\"reasonForLogsStatus\":\"svqwhbmdgbbjfd\"},{\"id\":\"mbmbexppbh\",\"sendingMetrics\":false,\"reasonForMetricsStatus\":\"ol\",\"sendingLogs\":true,\"reasonForLogsStatus\":\"s\"},{\"id\":\"gbquxigj\",\"sendingMetrics\":true,\"reasonForMetricsStatus\":\"jaoyfhrtx\",\"sendingLogs\":false,\"reasonForLogsStatus\":\"rkujy\"}],\"nextLink\":\"l\"}") - .toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("qqedqytbciqfou", model.value().get(0).id()); - Assertions.assertEquals(true, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("nkzsmodmglou", model.value().get(0).reasonForMetricsStatus()); - Assertions.assertEquals(false, model.value().get(0).sendingLogs()); - Assertions.assertEquals("wtmutduq", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("l", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoredResourceListResponse model = - new MonitoredResourceListResponse() - .withValue( - Arrays - .asList( - new MonitoredResourceInner() - .withId("qqedqytbciqfou") - .withSendingMetrics(true) - .withReasonForMetricsStatus("nkzsmodmglou") - .withSendingLogs(false) - .withReasonForLogsStatus("wtmutduq"), - new MonitoredResourceInner() - .withId("ap") - .withSendingMetrics(false) - .withReasonForMetricsStatus("cuertu") - .withSendingLogs(true) - .withReasonForLogsStatus("svqwhbmdgbbjfd"), - new MonitoredResourceInner() - .withId("mbmbexppbh") - .withSendingMetrics(false) - .withReasonForMetricsStatus("ol") - .withSendingLogs(true) - .withReasonForLogsStatus("s"), - new MonitoredResourceInner() - .withId("gbquxigj") - .withSendingMetrics(true) - .withReasonForMetricsStatus("jaoyfhrtx") - .withSendingLogs(false) - .withReasonForLogsStatus("rkujy"))) - .withNextLink("l"); - model = BinaryData.fromObject(model).toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("qqedqytbciqfou", model.value().get(0).id()); - Assertions.assertEquals(true, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("nkzsmodmglou", model.value().get(0).reasonForMetricsStatus()); - Assertions.assertEquals(false, model.value().get(0).sendingLogs()); - Assertions.assertEquals("wtmutduq", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("l", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesInnerTests.java deleted file mode 100644 index a07f26c9d1fc9..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.MonitoringTagRulesInner; -import com.azure.resourcemanager.datadog.models.LogRules; -import com.azure.resourcemanager.datadog.models.MetricRules; -import com.azure.resourcemanager.datadog.models.MonitoringTagRulesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitoringTagRulesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoringTagRulesInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":false,\"sendSubscriptionLogs\":false,\"sendResourceLogs\":false,\"filteringTags\":[]},\"metricRules\":{\"filteringTags\":[]}},\"id\":\"vfaxkffeiith\",\"name\":\"vmezy\",\"type\":\"shxmzsbbzoggigrx\"}") - .toObject(MonitoringTagRulesInner.class); - Assertions.assertEquals(false, model.properties().logRules().sendAadLogs()); - Assertions.assertEquals(false, model.properties().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(false, model.properties().logRules().sendResourceLogs()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoringTagRulesInner model = - new MonitoringTagRulesInner() - .withProperties( - new MonitoringTagRulesProperties() - .withLogRules( - new LogRules() - .withSendAadLogs(false) - .withSendSubscriptionLogs(false) - .withSendResourceLogs(false) - .withFilteringTags(Arrays.asList())) - .withMetricRules(new MetricRules().withFilteringTags(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(MonitoringTagRulesInner.class); - Assertions.assertEquals(false, model.properties().logRules().sendAadLogs()); - Assertions.assertEquals(false, model.properties().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(false, model.properties().logRules().sendResourceLogs()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesListResponseTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesListResponseTests.java deleted file mode 100644 index c22d35274ad66..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesListResponseTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.MonitoringTagRulesInner; -import com.azure.resourcemanager.datadog.models.MonitoringTagRulesListResponse; -import com.azure.resourcemanager.datadog.models.MonitoringTagRulesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitoringTagRulesListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoringTagRulesListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"yifqrvkdvjsllrmv\",\"name\":\"d\",\"type\":\"watkpnpulexxb\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"iqzbq\",\"name\":\"vsovmyokac\",\"type\":\"pkwlhz\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"flbvvnchrkcciwwz\",\"name\":\"uqkhrsajiwku\",\"type\":\"foskghsauuimj\"},{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"ugidyjrr\",\"name\":\"byao\",\"type\":\"v\"}],\"nextLink\":\"csonpclhoco\"}") - .toObject(MonitoringTagRulesListResponse.class); - Assertions.assertEquals("csonpclhoco", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoringTagRulesListResponse model = - new MonitoringTagRulesListResponse() - .withValue( - Arrays - .asList( - new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()), - new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()), - new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()), - new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()))) - .withNextLink("csonpclhoco"); - model = BinaryData.fromObject(model).toObject(MonitoringTagRulesListResponse.class); - Assertions.assertEquals("csonpclhoco", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesPropertiesTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesPropertiesTests.java deleted file mode 100644 index 7e87d06477223..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitoringTagRulesPropertiesTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.FilteringTag; -import com.azure.resourcemanager.datadog.models.LogRules; -import com.azure.resourcemanager.datadog.models.MetricRules; -import com.azure.resourcemanager.datadog.models.MonitoringTagRulesProperties; -import com.azure.resourcemanager.datadog.models.TagAction; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitoringTagRulesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitoringTagRulesProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Deleted\",\"logRules\":{\"sendAadLogs\":false,\"sendSubscriptionLogs\":false,\"sendResourceLogs\":true,\"filteringTags\":[{\"name\":\"dptkoenkouk\",\"value\":\"udwtiukbl\",\"action\":\"Exclude\"},{\"name\":\"pocipazyxoegu\",\"value\":\"jnpiucgyg\",\"action\":\"Include\"}]},\"metricRules\":{\"filteringTags\":[{\"name\":\"pmr\",\"value\":\"izcdrqjsd\",\"action\":\"Exclude\"},{\"name\":\"fyhxde\",\"value\":\"jzicwifsjt\",\"action\":\"Exclude\"},{\"name\":\"bishcbkhajdeyea\",\"value\":\"p\",\"action\":\"Include\"},{\"name\":\"lpbuxwgipwhonowk\",\"value\":\"hwankixzbinjepu\",\"action\":\"Include\"}]}}") - .toObject(MonitoringTagRulesProperties.class); - Assertions.assertEquals(false, model.logRules().sendAadLogs()); - Assertions.assertEquals(false, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(true, model.logRules().sendResourceLogs()); - Assertions.assertEquals("dptkoenkouk", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("udwtiukbl", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals("pmr", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("izcdrqjsd", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitoringTagRulesProperties model = - new MonitoringTagRulesProperties() - .withLogRules( - new LogRules() - .withSendAadLogs(false) - .withSendSubscriptionLogs(false) - .withSendResourceLogs(true) - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("dptkoenkouk") - .withValue("udwtiukbl") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("pocipazyxoegu") - .withValue("jnpiucgyg") - .withAction(TagAction.INCLUDE)))) - .withMetricRules( - new MetricRules() - .withFilteringTags( - Arrays - .asList( - new FilteringTag() - .withName("pmr") - .withValue("izcdrqjsd") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("fyhxde") - .withValue("jzicwifsjt") - .withAction(TagAction.EXCLUDE), - new FilteringTag() - .withName("bishcbkhajdeyea") - .withValue("p") - .withAction(TagAction.INCLUDE), - new FilteringTag() - .withName("lpbuxwgipwhonowk") - .withValue("hwankixzbinjepu") - .withAction(TagAction.INCLUDE)))); - model = BinaryData.fromObject(model).toObject(MonitoringTagRulesProperties.class); - Assertions.assertEquals(false, model.logRules().sendAadLogs()); - Assertions.assertEquals(false, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(true, model.logRules().sendResourceLogs()); - Assertions.assertEquals("dptkoenkouk", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("udwtiukbl", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals("pmr", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("izcdrqjsd", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteMockTests.java deleted file mode 100644 index e640ef3a704ba..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.monitors().delete("blcg", "xzvlvqhjkbegib", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsMockTests.java deleted file mode 100644 index d533b07008e68..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListHostsMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.DatadogHost; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListHostsMockTests { - @Test - public void testListHosts() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"fudwpznt\",\"aliases\":[\"zhlrqjb\",\"ck\"],\"apps\":[\"hrxsbk\",\"vpycanuzbp\",\"kafkuwbcrnwbm\"],\"meta\":{\"agentVersion\":\"seyvj\",\"installMethod\":{\"tool\":\"tslhspkdeem\",\"toolVersion\":\"fm\",\"installerVersion\":\"gkvtmelmqkrhah\"},\"logsAgent\":{\"transport\":\"uahaquhcdhmd\"}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.monitors().listHosts("xtccmg", "udxytlmoyrx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fudwpznt", response.iterator().next().name()); - Assertions.assertEquals("zhlrqjb", response.iterator().next().aliases().get(0)); - Assertions.assertEquals("hrxsbk", response.iterator().next().apps().get(0)); - Assertions.assertEquals("seyvj", response.iterator().next().meta().agentVersion()); - Assertions.assertEquals("tslhspkdeem", response.iterator().next().meta().installMethod().tool()); - Assertions.assertEquals("fm", response.iterator().next().meta().installMethod().toolVersion()); - Assertions.assertEquals("gkvtmelmqkrhah", response.iterator().next().meta().installMethod().installerVersion()); - Assertions.assertEquals("uahaquhcdhmd", response.iterator().next().meta().logsAgent().transport()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesMockTests.java deleted file mode 100644 index ae6330079701e..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListLinkedResourcesMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.LinkedResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListLinkedResourcesMockTests { - @Test - public void testListLinkedResources() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"id\":\"omzlfmi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.monitors().listLinkedResources("alaexqpvfadmwsrc", "gvxp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("omzlfmi", response.iterator().next().id()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesMockTests.java deleted file mode 100644 index 5f5a6a57a0372..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/MonitorsListMonitoredResourcesMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.MonitoredResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MonitorsListMonitoredResourcesMockTests { - @Test - public void testListMonitoredResources() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ldawkzbaliourqha\",\"sendingMetrics\":true,\"reasonForMetricsStatus\":\"ashsfwxos\",\"sendingLogs\":false,\"reasonForLogsStatus\":\"cugicjoox\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.monitors().listMonitoredResources("gwb", "b", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ldawkzbaliourqha", response.iterator().next().id()); - Assertions.assertEquals(true, response.iterator().next().sendingMetrics()); - Assertions.assertEquals("ashsfwxos", response.iterator().next().reasonForMetricsStatus()); - Assertions.assertEquals(false, response.iterator().next().sendingLogs()); - Assertions.assertEquals("cugicjoox", response.iterator().next().reasonForLogsStatus()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationDisplayTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationDisplayTests.java deleted file mode 100644 index 042d1245b2490..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"lkhbz\",\"resource\":\"epgzgqexz\",\"operation\":\"c\",\"description\":\"c\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("lkhbz", model.provider()); - Assertions.assertEquals("epgzgqexz", model.resource()); - Assertions.assertEquals("c", model.operation()); - Assertions.assertEquals("c", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("lkhbz") - .withResource("epgzgqexz") - .withOperation("c") - .withDescription("c"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("lkhbz", model.provider()); - Assertions.assertEquals("epgzgqexz", model.resource()); - Assertions.assertEquals("c", model.operation()); - Assertions.assertEquals("c", model.description()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationListResultTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationListResultTests.java deleted file mode 100644 index c3283ef988814..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationListResultTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.OperationResultInner; -import com.azure.resourcemanager.datadog.models.OperationDisplay; -import com.azure.resourcemanager.datadog.models.OperationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"uouq\",\"display\":{\"provider\":\"wzwbnguitn\",\"resource\":\"izgazxu\",\"operation\":\"zuckyfi\",\"description\":\"fidfvzw\"},\"isDataAction\":false},{\"name\":\"tymw\",\"display\":{\"provider\":\"kfthwxmntei\",\"resource\":\"opvkmijcm\",\"operation\":\"dcuf\",\"description\":\"srp\"},\"isDataAction\":true},{\"name\":\"dnsezcxtbzs\",\"display\":{\"provider\":\"c\",\"resource\":\"newmdwzjeiachbo\",\"operation\":\"flnrosfqpteehzz\",\"description\":\"pyqr\"},\"isDataAction\":false},{\"name\":\"npvswjdkirso\",\"display\":{\"provider\":\"xhcr\",\"resource\":\"ohjtckw\",\"operation\":\"soifiyipjxsqw\",\"description\":\"rjb\"},\"isDataAction\":true}],\"nextLink\":\"cjxvsnbyxqab\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("uouq", model.value().get(0).name()); - Assertions.assertEquals("wzwbnguitn", model.value().get(0).display().provider()); - Assertions.assertEquals("izgazxu", model.value().get(0).display().resource()); - Assertions.assertEquals("zuckyfi", model.value().get(0).display().operation()); - Assertions.assertEquals("fidfvzw", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("cjxvsnbyxqab", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = - new OperationListResult() - .withValue( - Arrays - .asList( - new OperationResultInner() - .withName("uouq") - .withDisplay( - new OperationDisplay() - .withProvider("wzwbnguitn") - .withResource("izgazxu") - .withOperation("zuckyfi") - .withDescription("fidfvzw")) - .withIsDataAction(false), - new OperationResultInner() - .withName("tymw") - .withDisplay( - new OperationDisplay() - .withProvider("kfthwxmntei") - .withResource("opvkmijcm") - .withOperation("dcuf") - .withDescription("srp")) - .withIsDataAction(true), - new OperationResultInner() - .withName("dnsezcxtbzs") - .withDisplay( - new OperationDisplay() - .withProvider("c") - .withResource("newmdwzjeiachbo") - .withOperation("flnrosfqpteehzz") - .withDescription("pyqr")) - .withIsDataAction(false), - new OperationResultInner() - .withName("npvswjdkirso") - .withDisplay( - new OperationDisplay() - .withProvider("xhcr") - .withResource("ohjtckw") - .withOperation("soifiyipjxsqw") - .withDescription("rjb")) - .withIsDataAction(true))) - .withNextLink("cjxvsnbyxqab"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("uouq", model.value().get(0).name()); - Assertions.assertEquals("wzwbnguitn", model.value().get(0).display().provider()); - Assertions.assertEquals("izgazxu", model.value().get(0).display().resource()); - Assertions.assertEquals("zuckyfi", model.value().get(0).display().operation()); - Assertions.assertEquals("fidfvzw", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("cjxvsnbyxqab", model.nextLink()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationResultInnerTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationResultInnerTests.java deleted file mode 100644 index ce83c882d59cc..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationResultInnerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.fluent.models.OperationResultInner; -import com.azure.resourcemanager.datadog.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResultInner model = - BinaryData - .fromString( - "{\"name\":\"ocpcy\",\"display\":{\"provider\":\"rzafbljjgpbtoqcj\",\"resource\":\"ljavbqid\",\"operation\":\"ajzyul\",\"description\":\"u\"},\"isDataAction\":true}") - .toObject(OperationResultInner.class); - Assertions.assertEquals("ocpcy", model.name()); - Assertions.assertEquals("rzafbljjgpbtoqcj", model.display().provider()); - Assertions.assertEquals("ljavbqid", model.display().resource()); - Assertions.assertEquals("ajzyul", model.display().operation()); - Assertions.assertEquals("u", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultInner model = - new OperationResultInner() - .withName("ocpcy") - .withDisplay( - new OperationDisplay() - .withProvider("rzafbljjgpbtoqcj") - .withResource("ljavbqid") - .withOperation("ajzyul") - .withDescription("u")) - .withIsDataAction(true); - model = BinaryData.fromObject(model).toObject(OperationResultInner.class); - Assertions.assertEquals("ocpcy", model.name()); - Assertions.assertEquals("rzafbljjgpbtoqcj", model.display().provider()); - Assertions.assertEquals("ljavbqid", model.display().resource()); - Assertions.assertEquals("ajzyul", model.display().operation()); - Assertions.assertEquals("u", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationsListMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationsListMockTests.java deleted file mode 100644 index 5712f2d3e57e8..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/OperationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.OperationResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"exrmcqibycnojvk\",\"display\":{\"provider\":\"fqsgzvahapjy\",\"resource\":\"pvgqzcjrvxdjzlm\",\"operation\":\"xkvugfhzov\",\"description\":\"jvzunluthnnp\"},\"isDataAction\":true}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("exrmcqibycnojvk", response.iterator().next().name()); - Assertions.assertEquals("fqsgzvahapjy", response.iterator().next().display().provider()); - Assertions.assertEquals("pvgqzcjrvxdjzlm", response.iterator().next().display().resource()); - Assertions.assertEquals("xkvugfhzov", response.iterator().next().display().operation()); - Assertions.assertEquals("jvzunluthnnp", response.iterator().next().display().description()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/ResourceSkuTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/ResourceSkuTests.java deleted file mode 100644 index 0aead0ae613fb..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/ResourceSkuTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.ResourceSku; -import org.junit.jupiter.api.Assertions; - -public final class ResourceSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSku model = BinaryData.fromString("{\"name\":\"lazjdyggdtjixhbk\"}").toObject(ResourceSku.class); - Assertions.assertEquals("lazjdyggdtjixhbk", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSku model = new ResourceSku().withName("lazjdyggdtjixhbk"); - model = BinaryData.fromObject(model).toObject(ResourceSku.class); - Assertions.assertEquals("lazjdyggdtjixhbk", model.name()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateMockTests.java deleted file mode 100644 index 826c2b462c01d..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnProperties; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnResource; -import com.azure.resourcemanager.datadog.models.SingleSignOnStates; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SingleSignOnConfigurationsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"nqpeh\",\"singleSignOnUrl\":\"doy\"},\"id\":\"ifthnz\",\"name\":\"ndslgnayqigynduh\",\"type\":\"vhqlkthumaqo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatadogSingleSignOnResource response = - manager - .singleSignOnConfigurations() - .define("gjb") - .withExistingMonitor("rruvwbhsq", "sub") - .withProperties( - new DatadogSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.EXISTING) - .withEnterpriseAppId("srfbjfdtwss")) - .create(); - - Assertions.assertEquals(SingleSignOnStates.INITIAL, response.properties().singleSignOnState()); - Assertions.assertEquals("nqpeh", response.properties().enterpriseAppId()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetWithResponseMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 020e75ff8fdef..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnResource; -import com.azure.resourcemanager.datadog.models.SingleSignOnStates; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SingleSignOnConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Deleting\",\"singleSignOnState\":\"Disable\",\"enterpriseAppId\":\"blytk\",\"singleSignOnUrl\":\"mpew\"},\"id\":\"fbkrvrnsvs\",\"name\":\"q\",\"type\":\"ohxcrsbfova\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DatadogSingleSignOnResource response = - manager - .singleSignOnConfigurations() - .getWithResponse("ivetvtcq", "qtdo", "mcbxvwvxysl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SingleSignOnStates.DISABLE, response.properties().singleSignOnState()); - Assertions.assertEquals("blytk", response.properties().enterpriseAppId()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListMockTests.java deleted file mode 100644 index 11f5a098e6909..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/SingleSignOnConfigurationsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnResource; -import com.azure.resourcemanager.datadog.models.SingleSignOnStates; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SingleSignOnConfigurationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"singleSignOnState\":\"Disable\",\"enterpriseAppId\":\"nrmfqjhhk\",\"singleSignOnUrl\":\"pvjymjhxxjyng\"},\"id\":\"ivkrtsw\",\"name\":\"xqzvszjfa\",\"type\":\"vjfdx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.singleSignOnConfigurations().list("lzdahzxctobgbkdm", "izpost", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals(SingleSignOnStates.DISABLE, response.iterator().next().properties().singleSignOnState()); - Assertions.assertEquals("nrmfqjhhk", response.iterator().next().properties().enterpriseAppId()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateWithResponseMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 224d01a1ba2aa..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.LogRules; -import com.azure.resourcemanager.datadog.models.MetricRules; -import com.azure.resourcemanager.datadog.models.MonitoringTagRules; -import com.azure.resourcemanager.datadog.models.MonitoringTagRulesProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":true,\"sendSubscriptionLogs\":false,\"sendResourceLogs\":false,\"filteringTags\":[]},\"metricRules\":{\"filteringTags\":[]}},\"id\":\"lwptfdy\",\"name\":\"pfqbuaceopzf\",\"type\":\"rhhuaopppcqeqx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MonitoringTagRules response = - manager - .tagRules() - .define("dtpnapnyiropuhp") - .withExistingMonitor("hnrztfol", "bnxknalaulppg") - .withProperties( - new MonitoringTagRulesProperties() - .withLogRules( - new LogRules() - .withSendAadLogs(false) - .withSendSubscriptionLogs(false) - .withSendResourceLogs(true) - .withFilteringTags(Arrays.asList())) - .withMetricRules(new MetricRules().withFilteringTags(Arrays.asList()))) - .create(); - - Assertions.assertEquals(true, response.properties().logRules().sendAadLogs()); - Assertions.assertEquals(false, response.properties().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(false, response.properties().logRules().sendResourceLogs()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesGetWithResponseMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesGetWithResponseMockTests.java deleted file mode 100644 index 0e38d975c48a4..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.MonitoringTagRules; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Updating\",\"logRules\":{\"sendAadLogs\":false,\"sendSubscriptionLogs\":false,\"sendResourceLogs\":true,\"filteringTags\":[]},\"metricRules\":{\"filteringTags\":[]}},\"id\":\"jixisxyawjoyaqcs\",\"name\":\"yjpkiidzyexz\",\"type\":\"eli\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MonitoringTagRules response = - manager - .tagRules() - .getWithResponse("luu", "dttouwaboekqvkel", "smv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.properties().logRules().sendAadLogs()); - Assertions.assertEquals(false, response.properties().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(true, response.properties().logRules().sendResourceLogs()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesListMockTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesListMockTests.java deleted file mode 100644 index 36f502d1aedad..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/TagRulesListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.datadog.MicrosoftDatadogManager; -import com.azure.resourcemanager.datadog.models.MonitoringTagRules; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TagRulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{\"sendAadLogs\":true,\"sendSubscriptionLogs\":true,\"sendResourceLogs\":true,\"filteringTags\":[]},\"metricRules\":{\"filteringTags\":[]}},\"id\":\"kgpwoz\",\"name\":\"hkfpbs\",\"type\":\"yofd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - MicrosoftDatadogManager manager = - MicrosoftDatadogManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.tagRules().list("i", "eilpjzuaejxdu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(true, response.iterator().next().properties().logRules().sendAadLogs()); - Assertions.assertEquals(true, response.iterator().next().properties().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(true, response.iterator().next().properties().logRules().sendResourceLogs()); - } -} diff --git a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/UserInfoTests.java b/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/UserInfoTests.java deleted file mode 100644 index e7d0293f336b3..0000000000000 --- a/sdk/datadog/azure-resourcemanager-datadog/src/test/java/com/azure/resourcemanager/datadog/generated/UserInfoTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datadog.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datadog.models.UserInfo; -import org.junit.jupiter.api.Assertions; - -public final class UserInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserInfo model = - BinaryData - .fromString("{\"name\":\"czsqpjhvm\",\"emailAddress\":\"jvnysounqe\",\"phoneNumber\":\"noae\"}") - .toObject(UserInfo.class); - Assertions.assertEquals("czsqpjhvm", model.name()); - Assertions.assertEquals("jvnysounqe", model.emailAddress()); - Assertions.assertEquals("noae", model.phoneNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserInfo model = new UserInfo().withName("czsqpjhvm").withEmailAddress("jvnysounqe").withPhoneNumber("noae"); - model = BinaryData.fromObject(model).toObject(UserInfo.class); - Assertions.assertEquals("czsqpjhvm", model.name()); - Assertions.assertEquals("jvnysounqe", model.emailAddress()); - Assertions.assertEquals("noae", model.phoneNumber()); - } -}