From 48443ba6ef309f6cf83f3874b03f62cd102e8c9d Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Sat, 7 Nov 2020 01:16:49 +0000 Subject: [PATCH] Generated from 2474e9d9015ad38abc0f9641fe2c612993faecdd --- sdk/datadog/mgmt-v2020_02_01_preview/pom.xml | 135 ++ .../datadog/v2020_02_01_preview/ApiKeys.java | 50 + .../DatadogAgreementProperties.java | 227 +++ .../DatadogAgreementResource.java | 40 + .../v2020_02_01_preview/DatadogApiKey.java | 40 + .../v2020_02_01_preview/DatadogHost.java | 41 + .../DatadogHostMetadata.java | 95 ++ .../DatadogInstallMethod.java | 95 ++ .../v2020_02_01_preview/DatadogLogsAgent.java | 43 + .../DatadogMonitorResource.java | 131 ++ ...atadogMonitorResourceUpdateParameters.java | 70 + .../DatadogOrganizationProperties.java | 126 ++ .../DatadogSetPasswordLink.java | 25 + .../DatadogSingleSignOnProperties.java | 95 ++ .../DatadogSingleSignOnResource.java | 117 ++ .../ErrorResponseBody.java | 122 ++ .../v2020_02_01_preview/FilteringTag.java | 96 ++ .../datadog/v2020_02_01_preview/Hosts.java | 29 + .../IdentityProperties.java | 73 + .../LiftrResourceCategories.java | 41 + .../v2020_02_01_preview/LinkedResource.java | 25 + .../v2020_02_01_preview/LinkedResources.java | 29 + .../datadog/v2020_02_01_preview/LogRules.java | 129 ++ .../ManagedIdentityTypes.java | 41 + .../MarketplaceAgreements.java | 28 + .../MarketplaceSubscriptionStatus.java | 41 + .../v2020_02_01_preview/MetricRules.java | 48 + .../MonitorProperties.java | 189 +++ .../MonitorUpdateProperties.java | 44 + .../MonitoredResource.java | 45 + .../MonitoredResources.java | 29 + .../v2020_02_01_preview/MonitoringStatus.java | 41 + .../MonitoringTagRules.java | 117 ++ .../MonitoringTagRulesProperties.java | 69 + .../datadog/v2020_02_01_preview/Monitors.java | 25 + .../v2020_02_01_preview/OperationDisplay.java | 121 ++ .../v2020_02_01_preview/OperationResult.java | 35 + .../v2020_02_01_preview/Operations.java | 27 + .../ProvisioningState.java | 62 + .../RefreshSetPasswords.java | 29 + .../ResourceProviderDefaultErrorResponse.java | 43 + ...ProviderDefaultErrorResponseException.java | 45 + .../v2020_02_01_preview/ResourceSku.java | 43 + .../SingleSignOnConfigurations.java | 41 + .../SingleSignOnStates.java | 47 + .../v2020_02_01_preview/TagAction.java | 41 + .../datadog/v2020_02_01_preview/TagRules.java | 41 + .../datadog/v2020_02_01_preview/UserInfo.java | 95 ++ .../implementation/ApiKeysImpl.java | 68 + .../implementation/ApiKeysInner.java | 570 ++++++++ .../DatadogAgreementResourceImpl.java | 52 + .../DatadogAgreementResourceInner.java | 45 + .../implementation/DatadogApiKeyImpl.java | 46 + .../implementation/DatadogApiKeyInner.java | 121 ++ .../implementation/DatadogHostImpl.java | 48 + .../implementation/DatadogHostInner.java | 123 ++ .../implementation/DatadogManager.java | 207 +++ .../DatadogMonitorResourceImpl.java | 110 ++ .../DatadogMonitorResourceInner.java | 99 ++ .../DatadogSetPasswordLinkImpl.java | 31 + .../DatadogSetPasswordLinkInner.java | 43 + .../DatadogSingleSignOnResourceImpl.java | 135 ++ .../DatadogSingleSignOnResourceInner.java | 45 + .../implementation/HostsImpl.java | 49 + .../implementation/HostsInner.java | 304 ++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/LinkedResourceImpl.java | 31 + .../implementation/LinkedResourceInner.java | 43 + .../implementation/LinkedResourcesImpl.java | 49 + .../implementation/LinkedResourcesInner.java | 304 ++++ .../MarketplaceAgreementsImpl.java | 80 + .../MarketplaceAgreementsInner.java | 436 ++++++ .../MicrosoftDatadogClientImpl.java | 322 +++++ .../implementation/MonitoredResourceImpl.java | 51 + .../MonitoredResourceInner.java | 149 ++ .../MonitoredResourcesImpl.java | 49 + .../MonitoredResourcesInner.java | 304 ++++ .../MonitoringTagRulesImpl.java | 135 ++ .../MonitoringTagRulesInner.java | 45 + .../implementation/MonitorsImpl.java | 138 ++ .../implementation/MonitorsInner.java | 1282 +++++++++++++++++ .../implementation/OperationResultImpl.java | 42 + .../implementation/OperationResultInner.java | 96 ++ .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 ++++ .../implementation/PageImpl.java | 75 + .../RefreshSetPasswordsImpl.java | 42 + .../RefreshSetPasswordsInner.java | 146 ++ .../SingleSignOnConfigurationsImpl.java | 78 + .../SingleSignOnConfigurationsInner.java | 770 ++++++++++ .../implementation/TagRulesImpl.java | 78 + .../implementation/TagRulesInner.java | 601 ++++++++ .../implementation/package-info.java | 10 + .../v2020_02_01_preview/package-info.java | 10 + 94 files changed, 11112 insertions(+) create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/pom.xml create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ApiKeys.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementResource.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogApiKey.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHost.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHostMetadata.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogInstallMethod.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogLogsAgent.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResource.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResourceUpdateParameters.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogOrganizationProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSetPasswordLink.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnResource.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ErrorResponseBody.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/FilteringTag.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Hosts.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/IdentityProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LiftrResourceCategories.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResource.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResources.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LogRules.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ManagedIdentityTypes.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceAgreements.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceSubscriptionStatus.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MetricRules.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorUpdateProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResource.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResources.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringStatus.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRules.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRulesProperties.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Monitors.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationDisplay.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationResult.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Operations.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ProvisioningState.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/RefreshSetPasswords.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponse.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponseException.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceSku.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnConfigurations.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnStates.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagAction.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagRules.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/UserInfo.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogManager.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/IdParsingUtils.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MicrosoftDatadogClientImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/PageImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesImpl.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesInner.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/package-info.java create mode 100644 sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/package-info.java diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/pom.xml b/sdk/datadog/mgmt-v2020_02_01_preview/pom.xml new file mode 100644 index 0000000000000..1c9e86f105503 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.datadog.v2020_02_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-datadog + 1.0.0-beta + jar + Microsoft Azure SDK for Datadog Management + This package contains Microsoft Datadog Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ApiKeys.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ApiKeys.java new file mode 100644 index 0000000000000..e0276b64ae52c --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ApiKeys.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.ApiKeysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApiKeys. + */ +public interface ApiKeys extends HasInner { + /** + * List the api keys for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String monitorName); + + /** + * Get the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDefaultKeyAsync(String resourceGroupName, String monitorName); + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable setDefaultKeyAsync(String resourceGroupName, String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementProperties.java new file mode 100644 index 0000000000000..6f04139153cbb --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementProperties.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Terms properties. + */ +public class DatadogAgreementProperties { + /** + * Publisher identifier string. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Product identifier string. + */ + @JsonProperty(value = "product") + private String product; + + /** + * Plan identifier string. + */ + @JsonProperty(value = "plan") + private String plan; + + /** + * Link to HTML with Microsoft and Publisher terms. + */ + @JsonProperty(value = "licenseTextLink") + private String licenseTextLink; + + /** + * Link to the privacy policy of the publisher. + */ + @JsonProperty(value = "privacyPolicyLink") + private String privacyPolicyLink; + + /** + * Date and time in UTC of when the terms were accepted. This is empty if + * Accepted is false. + */ + @JsonProperty(value = "retrieveDatetime") + private DateTime retrieveDatetime; + + /** + * Terms signature. + */ + @JsonProperty(value = "signature") + private String signature; + + /** + * If any version of the terms have been accepted, otherwise false. + */ + @JsonProperty(value = "accepted") + private Boolean accepted; + + /** + * Get publisher identifier string. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set publisher identifier string. + * + * @param publisher the publisher value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get product identifier string. + * + * @return the product value + */ + public String product() { + return this.product; + } + + /** + * Set product identifier string. + * + * @param product the product value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get plan identifier string. + * + * @return the plan value + */ + public String plan() { + return this.plan; + } + + /** + * Set plan identifier string. + * + * @param plan the plan value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withPlan(String plan) { + this.plan = plan; + return this; + } + + /** + * Get link to HTML with Microsoft and Publisher terms. + * + * @return the licenseTextLink value + */ + public String licenseTextLink() { + return this.licenseTextLink; + } + + /** + * Set link to HTML with Microsoft and Publisher terms. + * + * @param licenseTextLink the licenseTextLink value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withLicenseTextLink(String licenseTextLink) { + this.licenseTextLink = licenseTextLink; + return this; + } + + /** + * Get link to the privacy policy of the publisher. + * + * @return the privacyPolicyLink value + */ + public String privacyPolicyLink() { + return this.privacyPolicyLink; + } + + /** + * Set link to the privacy policy of the publisher. + * + * @param privacyPolicyLink the privacyPolicyLink value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withPrivacyPolicyLink(String privacyPolicyLink) { + this.privacyPolicyLink = privacyPolicyLink; + return this; + } + + /** + * Get date and time in UTC of when the terms were accepted. This is empty if Accepted is false. + * + * @return the retrieveDatetime value + */ + public DateTime retrieveDatetime() { + return this.retrieveDatetime; + } + + /** + * Set date and time in UTC of when the terms were accepted. This is empty if Accepted is false. + * + * @param retrieveDatetime the retrieveDatetime value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withRetrieveDatetime(DateTime retrieveDatetime) { + this.retrieveDatetime = retrieveDatetime; + return this; + } + + /** + * Get terms signature. + * + * @return the signature value + */ + public String signature() { + return this.signature; + } + + /** + * Set terms signature. + * + * @param signature the signature value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withSignature(String signature) { + this.signature = signature; + return this; + } + + /** + * Get if any version of the terms have been accepted, otherwise false. + * + * @return the accepted value + */ + public Boolean accepted() { + return this.accepted; + } + + /** + * Set if any version of the terms have been accepted, otherwise false. + * + * @param accepted the accepted value to set + * @return the DatadogAgreementProperties object itself. + */ + public DatadogAgreementProperties withAccepted(Boolean accepted) { + this.accepted = accepted; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementResource.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementResource.java new file mode 100644 index 0000000000000..677ad6d73bdd7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogAgreementResource.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogAgreementResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; + +/** + * Type representing DatadogAgreementResource. + */ +public interface DatadogAgreementResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + DatadogAgreementProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogApiKey.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogApiKey.java new file mode 100644 index 0000000000000..4c7229cfbe4d8 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogApiKey.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogApiKeyInner; + +/** + * Type representing DatadogApiKey. + */ +public interface DatadogApiKey extends HasInner, HasManager { + /** + * @return the created value. + */ + String created(); + + /** + * @return the createdBy value. + */ + String createdBy(); + + /** + * @return the key value. + */ + String keyVal(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHost.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHost.java new file mode 100644 index 0000000000000..dc67987f509a2 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHost.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogHostInner; +import java.util.List; + +/** + * Type representing DatadogHost. + */ +public interface DatadogHost extends HasInner, HasManager { + /** + * @return the aliases value. + */ + List aliases(); + + /** + * @return the apps value. + */ + List apps(); + + /** + * @return the meta value. + */ + DatadogHostMetadata meta(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHostMetadata.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHostMetadata.java new file mode 100644 index 0000000000000..0a0a71907a831 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogHostMetadata.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogHostMetadata model. + */ +public class DatadogHostMetadata { + /** + * The agent version. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /** + * The installMethod property. + */ + @JsonProperty(value = "installMethod") + private DatadogInstallMethod installMethod; + + /** + * The logsAgent property. + */ + @JsonProperty(value = "logsAgent") + private DatadogLogsAgent logsAgent; + + /** + * Get the agent version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agent version. + * + * @param agentVersion the agentVersion value to set + * @return the DatadogHostMetadata object itself. + */ + public DatadogHostMetadata withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the installMethod value. + * + * @return the installMethod value + */ + public DatadogInstallMethod installMethod() { + return this.installMethod; + } + + /** + * Set the installMethod value. + * + * @param installMethod the installMethod value to set + * @return the DatadogHostMetadata object itself. + */ + public DatadogHostMetadata withInstallMethod(DatadogInstallMethod installMethod) { + this.installMethod = installMethod; + return this; + } + + /** + * Get the logsAgent value. + * + * @return the logsAgent value + */ + public DatadogLogsAgent logsAgent() { + return this.logsAgent; + } + + /** + * Set the logsAgent value. + * + * @param logsAgent the logsAgent value to set + * @return the DatadogHostMetadata object itself. + */ + public DatadogHostMetadata withLogsAgent(DatadogLogsAgent logsAgent) { + this.logsAgent = logsAgent; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogInstallMethod.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogInstallMethod.java new file mode 100644 index 0000000000000..9a3c9a15ff875 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogInstallMethod.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogInstallMethod model. + */ +public class DatadogInstallMethod { + /** + * The tool. + */ + @JsonProperty(value = "tool") + private String tool; + + /** + * The tool version. + */ + @JsonProperty(value = "toolVersion") + private String toolVersion; + + /** + * The installer version. + */ + @JsonProperty(value = "installerVersion") + private String installerVersion; + + /** + * Get the tool. + * + * @return the tool value + */ + public String tool() { + return this.tool; + } + + /** + * Set the tool. + * + * @param tool the tool value to set + * @return the DatadogInstallMethod object itself. + */ + public DatadogInstallMethod withTool(String tool) { + this.tool = tool; + return this; + } + + /** + * Get the tool version. + * + * @return the toolVersion value + */ + public String toolVersion() { + return this.toolVersion; + } + + /** + * Set the tool version. + * + * @param toolVersion the toolVersion value to set + * @return the DatadogInstallMethod object itself. + */ + public DatadogInstallMethod withToolVersion(String toolVersion) { + this.toolVersion = toolVersion; + return this; + } + + /** + * Get the installer version. + * + * @return the installerVersion value + */ + public String installerVersion() { + return this.installerVersion; + } + + /** + * Set the installer version. + * + * @param installerVersion the installerVersion value to set + * @return the DatadogInstallMethod object itself. + */ + public DatadogInstallMethod withInstallerVersion(String installerVersion) { + this.installerVersion = installerVersion; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogLogsAgent.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogLogsAgent.java new file mode 100644 index 0000000000000..b0e34975ee264 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogLogsAgent.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogLogsAgent model. + */ +public class DatadogLogsAgent { + /** + * The transport. + */ + @JsonProperty(value = "transport") + private String transport; + + /** + * Get the transport. + * + * @return the transport value + */ + public String transport() { + return this.transport; + } + + /** + * Set the transport. + * + * @param transport the transport value to set + * @return the DatadogLogsAgent object itself. + */ + public DatadogLogsAgent withTransport(String transport) { + this.transport = transport; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResource.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResource.java new file mode 100644 index 0000000000000..8d7e19178406d --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResource.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogMonitorResourceInner; + +/** + * Type representing DatadogMonitorResource. + */ +public interface DatadogMonitorResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * @return the properties value. + */ + MonitorProperties properties(); + + /** + * @return the sku value. + */ + ResourceSku sku(); + + /** + * The entirety of the DatadogMonitorResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DatadogMonitorResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DatadogMonitorResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DatadogMonitorResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the datadogmonitorresource definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity the identity parameter value + * @return the next definition stage + */ + WithCreate withIdentity(IdentityProperties identity); + } + + /** + * The stage of the datadogmonitorresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next definition stage + */ + WithCreate withProperties(MonitorProperties properties); + } + + /** + * The stage of the datadogmonitorresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku the sku parameter value + * @return the next definition stage + */ + WithCreate withSku(ResourceSku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties, DefinitionStages.WithSku { + } + } + /** + * The template for a DatadogMonitorResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of DatadogMonitorResource update stages. + */ + interface UpdateStages { + /** + * The stage of the datadogmonitorresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next update stage + */ + Update withProperties(MonitorUpdateProperties properties); + } + + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResourceUpdateParameters.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResourceUpdateParameters.java new file mode 100644 index 0000000000000..b0a725ac3155b --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogMonitorResourceUpdateParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for a PATCH request to a monitor resource. + */ +public class DatadogMonitorResourceUpdateParameters { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private MonitorUpdateProperties properties; + + /** + * The new tags of the monitor resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the properties value. + * + * @return the properties value + */ + public MonitorUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the DatadogMonitorResourceUpdateParameters object itself. + */ + public DatadogMonitorResourceUpdateParameters withProperties(MonitorUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the new tags of the monitor resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the new tags of the monitor resource. + * + * @param tags the tags value to set + * @return the DatadogMonitorResourceUpdateParameters object itself. + */ + public DatadogMonitorResourceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogOrganizationProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogOrganizationProperties.java new file mode 100644 index 0000000000000..8e4573a747a8a --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogOrganizationProperties.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Datadog organization properties. + */ +public class DatadogOrganizationProperties { + /** + * Name of the Datadog organization. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Id of the Datadog organization. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The auth code used to linking to an existing datadog organization. + */ + @JsonProperty(value = "linkingAuthCode") + private String linkingAuthCode; + + /** + * The client_id from an existing in exchange for an auth token to link + * organization. + */ + @JsonProperty(value = "linkingClientId") + private String linkingClientId; + + /** + * The Id of the Enterprise App used for Single sign on. + */ + @JsonProperty(value = "enterpriseAppId") + private String enterpriseAppId; + + /** + * Get name of the Datadog organization. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get id of the Datadog organization. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the auth code used to linking to an existing datadog organization. + * + * @return the linkingAuthCode value + */ + public String linkingAuthCode() { + return this.linkingAuthCode; + } + + /** + * Set the auth code used to linking to an existing datadog organization. + * + * @param linkingAuthCode the linkingAuthCode value to set + * @return the DatadogOrganizationProperties object itself. + */ + public DatadogOrganizationProperties withLinkingAuthCode(String linkingAuthCode) { + this.linkingAuthCode = linkingAuthCode; + return this; + } + + /** + * Get the client_id from an existing in exchange for an auth token to link organization. + * + * @return the linkingClientId value + */ + public String linkingClientId() { + return this.linkingClientId; + } + + /** + * Set the client_id from an existing in exchange for an auth token to link organization. + * + * @param linkingClientId the linkingClientId value to set + * @return the DatadogOrganizationProperties object itself. + */ + public DatadogOrganizationProperties withLinkingClientId(String linkingClientId) { + this.linkingClientId = linkingClientId; + return this; + } + + /** + * Get the Id of the Enterprise App used for Single sign on. + * + * @return the enterpriseAppId value + */ + public String enterpriseAppId() { + return this.enterpriseAppId; + } + + /** + * Set the Id of the Enterprise App used for Single sign on. + * + * @param enterpriseAppId the enterpriseAppId value to set + * @return the DatadogOrganizationProperties object itself. + */ + public DatadogOrganizationProperties withEnterpriseAppId(String enterpriseAppId) { + this.enterpriseAppId = enterpriseAppId; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSetPasswordLink.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSetPasswordLink.java new file mode 100644 index 0000000000000..3c5d51b22127d --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSetPasswordLink.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogSetPasswordLinkInner; + +/** + * Type representing DatadogSetPasswordLink. + */ +public interface DatadogSetPasswordLink extends HasInner, HasManager { + /** + * @return the setPasswordLink value. + */ + String setPasswordLink(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnProperties.java new file mode 100644 index 0000000000000..3ad6853eb4a25 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogSingleSignOnProperties model. + */ +public class DatadogSingleSignOnProperties { + /** + * Possible values include: 'Initial', 'Enable', 'Disable', 'Existing'. + */ + @JsonProperty(value = "singleSignOnState") + private SingleSignOnStates singleSignOnState; + + /** + * The Id of the Enterprise App used for Single sign-on. + */ + @JsonProperty(value = "enterpriseAppId") + private String enterpriseAppId; + + /** + * The login URL specific to this Datadog Organization. + */ + @JsonProperty(value = "singleSignOnUrl") + private String singleSignOnUrl; + + /** + * Get possible values include: 'Initial', 'Enable', 'Disable', 'Existing'. + * + * @return the singleSignOnState value + */ + public SingleSignOnStates singleSignOnState() { + return this.singleSignOnState; + } + + /** + * Set possible values include: 'Initial', 'Enable', 'Disable', 'Existing'. + * + * @param singleSignOnState the singleSignOnState value to set + * @return the DatadogSingleSignOnProperties object itself. + */ + public DatadogSingleSignOnProperties withSingleSignOnState(SingleSignOnStates singleSignOnState) { + this.singleSignOnState = singleSignOnState; + return this; + } + + /** + * Get the Id of the Enterprise App used for Single sign-on. + * + * @return the enterpriseAppId value + */ + public String enterpriseAppId() { + return this.enterpriseAppId; + } + + /** + * Set the Id of the Enterprise App used for Single sign-on. + * + * @param enterpriseAppId the enterpriseAppId value to set + * @return the DatadogSingleSignOnProperties object itself. + */ + public DatadogSingleSignOnProperties withEnterpriseAppId(String enterpriseAppId) { + this.enterpriseAppId = enterpriseAppId; + return this; + } + + /** + * Get the login URL specific to this Datadog Organization. + * + * @return the singleSignOnUrl value + */ + public String singleSignOnUrl() { + return this.singleSignOnUrl; + } + + /** + * Set the login URL specific to this Datadog Organization. + * + * @param singleSignOnUrl the singleSignOnUrl value to set + * @return the DatadogSingleSignOnProperties object itself. + */ + public DatadogSingleSignOnProperties withSingleSignOnUrl(String singleSignOnUrl) { + this.singleSignOnUrl = singleSignOnUrl; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnResource.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnResource.java new file mode 100644 index 0000000000000..bd07a786a62c6 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/DatadogSingleSignOnResource.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogSingleSignOnResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; + +/** + * Type representing DatadogSingleSignOnResource. + */ +public interface DatadogSingleSignOnResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + DatadogSingleSignOnProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DatadogSingleSignOnResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMonitor, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of DatadogSingleSignOnResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DatadogSingleSignOnResource definition. + */ + interface Blank extends WithMonitor { + } + + /** + * The stage of the datadogsinglesignonresource definition allowing to specify Monitor. + */ + interface WithMonitor { + /** + * Specifies resourceGroupName, monitorName. + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs + * @param monitorName Monitor resource name + * @return the next definition stage + */ + WithProperties withExistingMonitor(String resourceGroupName, String monitorName); + } + + /** + * The stage of the datadogsinglesignonresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next definition stage + */ + WithCreate withProperties(DatadogSingleSignOnProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a DatadogSingleSignOnResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of DatadogSingleSignOnResource update stages. + */ + interface UpdateStages { + /** + * The stage of the datadogsinglesignonresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next update stage + */ + Update withProperties(DatadogSingleSignOnProperties properties); + } + + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ErrorResponseBody.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ErrorResponseBody.java new file mode 100644 index 0000000000000..b25a59745c9a7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ErrorResponseBody.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorResponseBody model. + */ +public class ErrorResponseBody { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/FilteringTag.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/FilteringTag.java new file mode 100644 index 0000000000000..d4a83a16f6a41 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/FilteringTag.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a filtering tag. Filtering tags are used for capturing + * resources and include/exclude them from being monitored. + */ +public class FilteringTag { + /** + * The name (also known as the key) of the tag. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the tag. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Possible values include: 'Include', 'Exclude'. + */ + @JsonProperty(value = "action") + private TagAction action; + + /** + * Get the name (also known as the key) of the tag. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name (also known as the key) of the tag. + * + * @param name the name value to set + * @return the FilteringTag object itself. + */ + public FilteringTag withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the tag. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the tag. + * + * @param value the value value to set + * @return the FilteringTag object itself. + */ + public FilteringTag withValue(String value) { + this.value = value; + return this; + } + + /** + * Get possible values include: 'Include', 'Exclude'. + * + * @return the action value + */ + public TagAction action() { + return this.action; + } + + /** + * Set possible values include: 'Include', 'Exclude'. + * + * @param action the action value to set + * @return the FilteringTag object itself. + */ + public FilteringTag withAction(TagAction action) { + this.action = action; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Hosts.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Hosts.java new file mode 100644 index 0000000000000..ae423d29decc7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Hosts.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.HostsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Hosts. + */ +public interface Hosts extends HasInner { + /** + * List the hosts for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/IdentityProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/IdentityProperties.java new file mode 100644 index 0000000000000..da492b57092d9 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/IdentityProperties.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IdentityProperties model. + */ +public class IdentityProperties { + /** + * The identity ID. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Possible values include: 'SystemAssigned', 'UserAssigned'. + */ + @JsonProperty(value = "type") + private ManagedIdentityTypes type; + + /** + * Get the identity ID. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get possible values include: 'SystemAssigned', 'UserAssigned'. + * + * @return the type value + */ + public ManagedIdentityTypes type() { + return this.type; + } + + /** + * Set possible values include: 'SystemAssigned', 'UserAssigned'. + * + * @param type the type value to set + * @return the IdentityProperties object itself. + */ + public IdentityProperties withType(ManagedIdentityTypes type) { + this.type = type; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LiftrResourceCategories.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LiftrResourceCategories.java new file mode 100644 index 0000000000000..47c48dbf3fcc1 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LiftrResourceCategories.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LiftrResourceCategories. + */ +public final class LiftrResourceCategories extends ExpandableStringEnum { + /** Static value Unknown for LiftrResourceCategories. */ + public static final LiftrResourceCategories UNKNOWN = fromString("Unknown"); + + /** Static value MonitorLogs for LiftrResourceCategories. */ + public static final LiftrResourceCategories MONITOR_LOGS = fromString("MonitorLogs"); + + /** + * Creates or finds a LiftrResourceCategories from its string representation. + * @param name a name to look for + * @return the corresponding LiftrResourceCategories + */ + @JsonCreator + public static LiftrResourceCategories fromString(String name) { + return fromString(name, LiftrResourceCategories.class); + } + + /** + * @return known LiftrResourceCategories values + */ + public static Collection values() { + return values(LiftrResourceCategories.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResource.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResource.java new file mode 100644 index 0000000000000..e5e5981dcd245 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResource.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.LinkedResourceInner; + +/** + * Type representing LinkedResource. + */ +public interface LinkedResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResources.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResources.java new file mode 100644 index 0000000000000..69428342aa045 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LinkedResources.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.LinkedResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LinkedResources. + */ +public interface LinkedResources extends HasInner { + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LogRules.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LogRules.java new file mode 100644 index 0000000000000..b03a0b5c2835b --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/LogRules.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Set of rules for sending logs for the Monitor resource. + */ +public class LogRules { + /** + * Flag specifying if AAD logs should be sent for the Monitor resource. + */ + @JsonProperty(value = "sendAadLogs") + private Boolean sendAadLogs; + + /** + * Flag specifying if Azure subscription logs should be sent for the + * Monitor resource. + */ + @JsonProperty(value = "sendSubscriptionLogs") + private Boolean sendSubscriptionLogs; + + /** + * Flag specifying if Azure resource logs should be sent for the Monitor + * resource. + */ + @JsonProperty(value = "sendResourceLogs") + private Boolean sendResourceLogs; + + /** + * List of filtering tags to be used for capturing logs. This only takes + * effect if SendResourceLogs flag is enabled. If empty, all resources will + * be captured. If only Exclude action is specified, the rules will apply + * to the list of all available resources. If Include actions are + * specified, the rules will only include resources with the associated + * tags. + */ + @JsonProperty(value = "filteringTags") + private List filteringTags; + + /** + * Get flag specifying if AAD logs should be sent for the Monitor resource. + * + * @return the sendAadLogs value + */ + public Boolean sendAadLogs() { + return this.sendAadLogs; + } + + /** + * Set flag specifying if AAD logs should be sent for the Monitor resource. + * + * @param sendAadLogs the sendAadLogs value to set + * @return the LogRules object itself. + */ + public LogRules withSendAadLogs(Boolean sendAadLogs) { + this.sendAadLogs = sendAadLogs; + return this; + } + + /** + * Get flag specifying if Azure subscription logs should be sent for the Monitor resource. + * + * @return the sendSubscriptionLogs value + */ + public Boolean sendSubscriptionLogs() { + return this.sendSubscriptionLogs; + } + + /** + * Set flag specifying if Azure subscription logs should be sent for the Monitor resource. + * + * @param sendSubscriptionLogs the sendSubscriptionLogs value to set + * @return the LogRules object itself. + */ + public LogRules withSendSubscriptionLogs(Boolean sendSubscriptionLogs) { + this.sendSubscriptionLogs = sendSubscriptionLogs; + return this; + } + + /** + * Get flag specifying if Azure resource logs should be sent for the Monitor resource. + * + * @return the sendResourceLogs value + */ + public Boolean sendResourceLogs() { + return this.sendResourceLogs; + } + + /** + * Set flag specifying if Azure resource logs should be sent for the Monitor resource. + * + * @param sendResourceLogs the sendResourceLogs value to set + * @return the LogRules object itself. + */ + public LogRules withSendResourceLogs(Boolean sendResourceLogs) { + this.sendResourceLogs = sendResourceLogs; + return this; + } + + /** + * Get list of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + * + * @return the filteringTags value + */ + public List filteringTags() { + return this.filteringTags; + } + + /** + * Set list of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + * + * @param filteringTags the filteringTags value to set + * @return the LogRules object itself. + */ + public LogRules withFilteringTags(List filteringTags) { + this.filteringTags = filteringTags; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ManagedIdentityTypes.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ManagedIdentityTypes.java new file mode 100644 index 0000000000000..ebb2b8da521c4 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ManagedIdentityTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedIdentityTypes. + */ +public final class ManagedIdentityTypes extends ExpandableStringEnum { + /** Static value SystemAssigned for ManagedIdentityTypes. */ + public static final ManagedIdentityTypes SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityTypes. */ + public static final ManagedIdentityTypes USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates or finds a ManagedIdentityTypes from its string representation. + * @param name a name to look for + * @return the corresponding ManagedIdentityTypes + */ + @JsonCreator + public static ManagedIdentityTypes fromString(String name) { + return fromString(name, ManagedIdentityTypes.class); + } + + /** + * @return known ManagedIdentityTypes values + */ + public static Collection values() { + return values(ManagedIdentityTypes.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceAgreements.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceAgreements.java new file mode 100644 index 0000000000000..2d1adf677c405 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceAgreements.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.MarketplaceAgreementsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MarketplaceAgreements. + */ +public interface MarketplaceAgreements extends SupportsListing, HasInner { + /** + * Create Datadog marketplace agreement in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceSubscriptionStatus.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceSubscriptionStatus.java new file mode 100644 index 0000000000000..c01f76b20697f --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MarketplaceSubscriptionStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MarketplaceSubscriptionStatus. + */ +public final class MarketplaceSubscriptionStatus extends ExpandableStringEnum { + /** Static value Active for MarketplaceSubscriptionStatus. */ + public static final MarketplaceSubscriptionStatus ACTIVE = fromString("Active"); + + /** Static value Suspended for MarketplaceSubscriptionStatus. */ + public static final MarketplaceSubscriptionStatus SUSPENDED = fromString("Suspended"); + + /** + * Creates or finds a MarketplaceSubscriptionStatus from its string representation. + * @param name a name to look for + * @return the corresponding MarketplaceSubscriptionStatus + */ + @JsonCreator + public static MarketplaceSubscriptionStatus fromString(String name) { + return fromString(name, MarketplaceSubscriptionStatus.class); + } + + /** + * @return known MarketplaceSubscriptionStatus values + */ + public static Collection values() { + return values(MarketplaceSubscriptionStatus.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MetricRules.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MetricRules.java new file mode 100644 index 0000000000000..131acf9466ebd --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MetricRules.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Set of rules for sending metrics for the Monitor resource. + */ +public class MetricRules { + /** + * List of filtering tags to be used for capturing metrics. If empty, all + * resources will be captured. If only Exclude action is specified, the + * rules will apply to the list of all available resources. If Include + * actions are specified, the rules will only include resources with the + * associated tags. + */ + @JsonProperty(value = "filteringTags") + private List filteringTags; + + /** + * Get list of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + * + * @return the filteringTags value + */ + public List filteringTags() { + return this.filteringTags; + } + + /** + * Set list of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + * + * @param filteringTags the filteringTags value to set + * @return the MetricRules object itself. + */ + public MetricRules withFilteringTags(List filteringTags) { + this.filteringTags = filteringTags; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorProperties.java new file mode 100644 index 0000000000000..594887f70f53d --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorProperties.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties specific to the monitor resource. + */ +public class MonitorProperties { + /** + * Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified'. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /** + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "monitoringStatus") + private MonitoringStatus monitoringStatus; + + /** + * Possible values include: 'Active', 'Suspended'. + */ + @JsonProperty(value = "marketplaceSubscriptionStatus") + private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; + + /** + * The datadogOrganizationProperties property. + */ + @JsonProperty(value = "datadogOrganizationProperties") + private DatadogOrganizationProperties datadogOrganizationProperties; + + /** + * The userInfo property. + */ + @JsonProperty(value = "userInfo") + private UserInfo userInfo; + + /** + * Possible values include: 'Unknown', 'MonitorLogs'. + */ + @JsonProperty(value = "liftrResourceCategory") + private LiftrResourceCategories liftrResourceCategory; + + /** + * The priority of the resource. + */ + @JsonProperty(value = "liftrResourcePreference", access = JsonProperty.Access.WRITE_ONLY) + private Integer liftrResourcePreference; + + /** + * Get possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified'. + * + * @param provisioningState the provisioningState value to set + * @return the MonitorProperties object itself. + */ + public MonitorProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get possible values include: 'Enabled', 'Disabled'. + * + * @return the monitoringStatus value + */ + public MonitoringStatus monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set possible values include: 'Enabled', 'Disabled'. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the MonitorProperties object itself. + */ + public MonitorProperties withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + + /** + * Get possible values include: 'Active', 'Suspended'. + * + * @return the marketplaceSubscriptionStatus value + */ + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.marketplaceSubscriptionStatus; + } + + /** + * Set possible values include: 'Active', 'Suspended'. + * + * @param marketplaceSubscriptionStatus the marketplaceSubscriptionStatus value to set + * @return the MonitorProperties object itself. + */ + public MonitorProperties withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus marketplaceSubscriptionStatus) { + this.marketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + return this; + } + + /** + * Get the datadogOrganizationProperties value. + * + * @return the datadogOrganizationProperties value + */ + public DatadogOrganizationProperties datadogOrganizationProperties() { + return this.datadogOrganizationProperties; + } + + /** + * Set the datadogOrganizationProperties value. + * + * @param datadogOrganizationProperties the datadogOrganizationProperties value to set + * @return the MonitorProperties object itself. + */ + public MonitorProperties withDatadogOrganizationProperties(DatadogOrganizationProperties datadogOrganizationProperties) { + this.datadogOrganizationProperties = datadogOrganizationProperties; + return this; + } + + /** + * Get the userInfo value. + * + * @return the userInfo value + */ + public UserInfo userInfo() { + return this.userInfo; + } + + /** + * Set the userInfo value. + * + * @param userInfo the userInfo value to set + * @return the MonitorProperties object itself. + */ + public MonitorProperties withUserInfo(UserInfo userInfo) { + this.userInfo = userInfo; + return this; + } + + /** + * Get possible values include: 'Unknown', 'MonitorLogs'. + * + * @return the liftrResourceCategory value + */ + public LiftrResourceCategories liftrResourceCategory() { + return this.liftrResourceCategory; + } + + /** + * Set possible values include: 'Unknown', 'MonitorLogs'. + * + * @param liftrResourceCategory the liftrResourceCategory value to set + * @return the MonitorProperties object itself. + */ + public MonitorProperties withLiftrResourceCategory(LiftrResourceCategories liftrResourceCategory) { + this.liftrResourceCategory = liftrResourceCategory; + return this; + } + + /** + * Get the priority of the resource. + * + * @return the liftrResourcePreference value + */ + public Integer liftrResourcePreference() { + return this.liftrResourcePreference; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorUpdateProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorUpdateProperties.java new file mode 100644 index 0000000000000..359a65ae931a5 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitorUpdateProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The set of properties that can be update in a PATCH request to a monitor + * resource. + */ +public class MonitorUpdateProperties { + /** + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "monitoringStatus") + private MonitoringStatus monitoringStatus; + + /** + * Get possible values include: 'Enabled', 'Disabled'. + * + * @return the monitoringStatus value + */ + public MonitoringStatus monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set possible values include: 'Enabled', 'Disabled'. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the MonitorUpdateProperties object itself. + */ + public MonitorUpdateProperties withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResource.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResource.java new file mode 100644 index 0000000000000..9fc8f2d31c4e6 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResource.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.MonitoredResourceInner; + +/** + * Type representing MonitoredResource. + */ +public interface MonitoredResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the reasonForLogsStatus value. + */ + String reasonForLogsStatus(); + + /** + * @return the reasonForMetricsStatus value. + */ + String reasonForMetricsStatus(); + + /** + * @return the sendingLogs value. + */ + Boolean sendingLogs(); + + /** + * @return the sendingMetrics value. + */ + Boolean sendingMetrics(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResources.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResources.java new file mode 100644 index 0000000000000..9ce2cfc12ad7a --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoredResources.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.MonitoredResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MonitoredResources. + */ +public interface MonitoredResources extends HasInner { + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringStatus.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringStatus.java new file mode 100644 index 0000000000000..f13f81e2c3d2b --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MonitoringStatus. + */ +public final class MonitoringStatus extends ExpandableStringEnum { + /** Static value Enabled for MonitoringStatus. */ + public static final MonitoringStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for MonitoringStatus. */ + public static final MonitoringStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a MonitoringStatus from its string representation. + * @param name a name to look for + * @return the corresponding MonitoringStatus + */ + @JsonCreator + public static MonitoringStatus fromString(String name) { + return fromString(name, MonitoringStatus.class); + } + + /** + * @return known MonitoringStatus values + */ + public static Collection values() { + return values(MonitoringStatus.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRules.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRules.java new file mode 100644 index 0000000000000..eb2d14020ceb8 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRules.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.MonitoringTagRulesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; + +/** + * Type representing MonitoringTagRules. + */ +public interface MonitoringTagRules extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + MonitoringTagRulesProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the MonitoringTagRules definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMonitor, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of MonitoringTagRules definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MonitoringTagRules definition. + */ + interface Blank extends WithMonitor { + } + + /** + * The stage of the monitoringtagrules definition allowing to specify Monitor. + */ + interface WithMonitor { + /** + * Specifies resourceGroupName, monitorName. + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs + * @param monitorName Monitor resource name + * @return the next definition stage + */ + WithProperties withExistingMonitor(String resourceGroupName, String monitorName); + } + + /** + * The stage of the monitoringtagrules definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next definition stage + */ + WithCreate withProperties(MonitoringTagRulesProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a MonitoringTagRules update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of MonitoringTagRules update stages. + */ + interface UpdateStages { + /** + * The stage of the monitoringtagrules update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties the properties parameter value + * @return the next update stage + */ + Update withProperties(MonitoringTagRulesProperties properties); + } + + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRulesProperties.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRulesProperties.java new file mode 100644 index 0000000000000..698072dd15fb7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/MonitoringTagRulesProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Definition of the properties for a TagRules resource. + */ +public class MonitoringTagRulesProperties { + /** + * The logRules property. + */ + @JsonProperty(value = "logRules") + private LogRules logRules; + + /** + * The metricRules property. + */ + @JsonProperty(value = "metricRules") + private MetricRules metricRules; + + /** + * Get the logRules value. + * + * @return the logRules value + */ + public LogRules logRules() { + return this.logRules; + } + + /** + * Set the logRules value. + * + * @param logRules the logRules value to set + * @return the MonitoringTagRulesProperties object itself. + */ + public MonitoringTagRulesProperties withLogRules(LogRules logRules) { + this.logRules = logRules; + return this; + } + + /** + * Get the metricRules value. + * + * @return the metricRules value + */ + public MetricRules metricRules() { + return this.metricRules; + } + + /** + * Set the metricRules value. + * + * @param metricRules the metricRules value to set + * @return the MonitoringTagRulesProperties object itself. + */ + public MonitoringTagRulesProperties withMetricRules(MetricRules metricRules) { + this.metricRules = metricRules; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Monitors.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Monitors.java new file mode 100644 index 0000000000000..540f590ab5e02 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Monitors.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.MonitorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Monitors. + */ +public interface Monitors extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationDisplay.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..1555d31040d57 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider, i.e., Microsoft.Datadog. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Type on which the operation is performed, e.g., 'monitors'. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation type, e.g., read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation, e.g., 'Write monitors'. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider, i.e., Microsoft.Datadog. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider, i.e., Microsoft.Datadog. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get type on which the operation is performed, e.g., 'monitors'. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set type on which the operation is performed, e.g., 'monitors'. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation type, e.g., read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type, e.g., read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation, e.g., 'Write monitors'. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation, e.g., 'Write monitors'. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationResult.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationResult.java new file mode 100644 index 0000000000000..0df048d8a9ec0 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/OperationResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.DatadogManager; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.OperationResultInner; + +/** + * Type representing OperationResult. + */ +public interface OperationResult extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Operations.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Operations.java new file mode 100644 index 0000000000000..62a5925b4fef3 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ProvisioningState.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ProvisioningState.java new file mode 100644 index 0000000000000..1499f21f7358c --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ProvisioningState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/RefreshSetPasswords.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/RefreshSetPasswords.java new file mode 100644 index 0000000000000..ea9189967755d --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/RefreshSetPasswords.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.RefreshSetPasswordsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RefreshSetPasswords. + */ +public interface RefreshSetPasswords extends HasInner { + /** + * Refresh the set password link and return a latest one. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponse.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponse.java new file mode 100644 index 0000000000000..0012e17b8cd8c --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceProviderDefaultErrorResponse model. + */ +public class ResourceProviderDefaultErrorResponse { + /** + * The error property. + */ + @JsonProperty(value = "error") + private ErrorResponseBody error; + + /** + * Get the error value. + * + * @return the error value + */ + public ErrorResponseBody error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the ResourceProviderDefaultErrorResponse object itself. + */ + public ResourceProviderDefaultErrorResponse withError(ErrorResponseBody error) { + this.error = error; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponseException.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponseException.java new file mode 100644 index 0000000000000..f99109dd362ee --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceProviderDefaultErrorResponseException.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with + * ResourceProviderDefaultErrorResponse information. + */ +public class ResourceProviderDefaultErrorResponseException extends RestException { + /** + * Initializes a new instance of the ResourceProviderDefaultErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ResourceProviderDefaultErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ResourceProviderDefaultErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ResourceProviderDefaultErrorResponseException(final String message, final Response response, final ResourceProviderDefaultErrorResponse body) { + super(message, response, body); + } + + @Override + public ResourceProviderDefaultErrorResponse body() { + return (ResourceProviderDefaultErrorResponse) super.body(); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceSku.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceSku.java new file mode 100644 index 0000000000000..304f14173b0aa --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/ResourceSku.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceSku model. + */ +public class ResourceSku { + /** + * Name of the SKU. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the SKU. + * + * @param name the name value to set + * @return the ResourceSku object itself. + */ + public ResourceSku withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnConfigurations.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnConfigurations.java new file mode 100644 index 0000000000000..c870a4c226254 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnConfigurations.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.SingleSignOnConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SingleSignOnConfigurations. + */ +public interface SingleSignOnConfigurations extends SupportsCreating, HasInner { + /** + * Gets the datadog single sign-on resource for the given Monitor. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String monitorName, String configurationName); + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnStates.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnStates.java new file mode 100644 index 0000000000000..a81117d7f9ffc --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/SingleSignOnStates.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SingleSignOnStates. + */ +public final class SingleSignOnStates extends ExpandableStringEnum { + /** Static value Initial for SingleSignOnStates. */ + public static final SingleSignOnStates INITIAL = fromString("Initial"); + + /** Static value Enable for SingleSignOnStates. */ + public static final SingleSignOnStates ENABLE = fromString("Enable"); + + /** Static value Disable for SingleSignOnStates. */ + public static final SingleSignOnStates DISABLE = fromString("Disable"); + + /** Static value Existing for SingleSignOnStates. */ + public static final SingleSignOnStates EXISTING = fromString("Existing"); + + /** + * Creates or finds a SingleSignOnStates from its string representation. + * @param name a name to look for + * @return the corresponding SingleSignOnStates + */ + @JsonCreator + public static SingleSignOnStates fromString(String name) { + return fromString(name, SingleSignOnStates.class); + } + + /** + * @return known SingleSignOnStates values + */ + public static Collection values() { + return values(SingleSignOnStates.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagAction.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagAction.java new file mode 100644 index 0000000000000..f51422aa8e1e6 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagAction.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TagAction. + */ +public final class TagAction extends ExpandableStringEnum { + /** Static value Include for TagAction. */ + public static final TagAction INCLUDE = fromString("Include"); + + /** Static value Exclude for TagAction. */ + public static final TagAction EXCLUDE = fromString("Exclude"); + + /** + * Creates or finds a TagAction from its string representation. + * @param name a name to look for + * @return the corresponding TagAction + */ + @JsonCreator + public static TagAction fromString(String name) { + return fromString(name, TagAction.class); + } + + /** + * @return known TagAction values + */ + public static Collection values() { + return values(TagAction.class); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagRules.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagRules.java new file mode 100644 index 0000000000000..3c6d52291500a --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/TagRules.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation.TagRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TagRules. + */ +public interface TagRules extends SupportsCreating, HasInner { + /** + * Get a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String monitorName, String ruleSetName); + + /** + * List the tag rules for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String monitorName); + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/UserInfo.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/UserInfo.java new file mode 100644 index 0000000000000..9e488aa68d8ce --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/UserInfo.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User info. + */ +public class UserInfo { + /** + * Name of the user. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Email of the user used by Datadog for contacting them if needed. + */ + @JsonProperty(value = "emailAddress") + private String emailAddress; + + /** + * Phone number of the user used by Datadog for contacting them if needed. + */ + @JsonProperty(value = "phoneNumber") + private String phoneNumber; + + /** + * Get name of the user. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the user. + * + * @param name the name value to set + * @return the UserInfo object itself. + */ + public UserInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get email of the user used by Datadog for contacting them if needed. + * + * @return the emailAddress value + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set email of the user used by Datadog for contacting them if needed. + * + * @param emailAddress the emailAddress value to set + * @return the UserInfo object itself. + */ + public UserInfo withEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Get phone number of the user used by Datadog for contacting them if needed. + * + * @return the phoneNumber value + */ + public String phoneNumber() { + return this.phoneNumber; + } + + /** + * Set phone number of the user used by Datadog for contacting them if needed. + * + * @param phoneNumber the phoneNumber value to set + * @return the UserInfo object itself. + */ + public UserInfo withPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysImpl.java new file mode 100644 index 0000000000000..e487052ef1fa7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ApiKeys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogApiKey; + +class ApiKeysImpl extends WrapperImpl implements ApiKeys { + private final DatadogManager manager; + + ApiKeysImpl(DatadogManager manager) { + super(manager.inner().apiKeys()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String monitorName) { + ApiKeysInner client = this.inner(); + return client.listAsync(resourceGroupName, monitorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatadogApiKey call(DatadogApiKeyInner inner) { + return new DatadogApiKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable getDefaultKeyAsync(String resourceGroupName, String monitorName) { + ApiKeysInner client = this.inner(); + return client.getDefaultKeyAsync(resourceGroupName, monitorName) + .map(new Func1() { + @Override + public DatadogApiKey call(DatadogApiKeyInner inner) { + return new DatadogApiKeyImpl(inner, manager()); + } + }); + } + + @Override + public Completable setDefaultKeyAsync(String resourceGroupName, String monitorName) { + ApiKeysInner client = this.inner(); + return client.setDefaultKeyAsync(resourceGroupName, monitorName).toCompletable(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysInner.java new file mode 100644 index 0000000000000..ff510542c92eb --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/ApiKeysInner.java @@ -0,0 +1,570 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiKeys. + */ +public class ApiKeysInner { + /** The Retrofit service to perform REST calls. */ + private ApiKeysService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of ApiKeysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApiKeysInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(ApiKeysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApiKeys to be + * used by Retrofit to perform actually REST calls. + */ + interface ApiKeysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.ApiKeys list" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.ApiKeys getDefaultKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey") + Observable> getDefaultKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.ApiKeys setDefaultKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey") + Observable> setDefaultKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Body DatadogApiKeyInner body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.ApiKeys listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the api keys for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogApiKeyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String monitorName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, monitorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the api keys for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String monitorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, monitorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the api keys for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogApiKeyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String monitorName) { + return listWithServiceResponseAsync(resourceGroupName, monitorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the api keys for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogApiKeyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String monitorName) { + return listSinglePageAsync(resourceGroupName, monitorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the api keys for a given monitor resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + ServiceResponse> * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogApiKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Get the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogApiKeyInner object if successful. + */ + public DatadogApiKeyInner getDefaultKey(String resourceGroupName, String monitorName) { + return getDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Get the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultKeyAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Get the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogApiKeyInner object + */ + public Observable getDefaultKeyAsync(String resourceGroupName, String monitorName) { + return getDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, DatadogApiKeyInner>() { + @Override + public DatadogApiKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogApiKeyInner object + */ + public Observable> getDefaultKeyWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDefaultKey(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultKeyDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void setDefaultKey(String resourceGroupName, String monitorName) { + setDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setDefaultKeyAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable setDefaultKeyAsync(String resourceGroupName, String monitorName) { + return setDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> setDefaultKeyWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final DatadogApiKeyInner body = null; + return service.setDefaultKey(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setDefaultKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogApiKeyInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void setDefaultKey(String resourceGroupName, String monitorName, DatadogApiKeyInner body) { + setDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName, body).toBlocking().single().body(); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogApiKeyInner value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setDefaultKeyAsync(String resourceGroupName, String monitorName, DatadogApiKeyInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName, body), serviceCallback); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogApiKeyInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable setDefaultKeyAsync(String resourceGroupName, String monitorName, DatadogApiKeyInner body) { + return setDefaultKeyWithServiceResponseAsync(resourceGroupName, monitorName, body).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set the default api key. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogApiKeyInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> setDefaultKeyWithServiceResponseAsync(String resourceGroupName, String monitorName, DatadogApiKeyInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.setDefaultKey(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setDefaultKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setDefaultKeyDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List the api keys for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogApiKeyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the api keys for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the api keys for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogApiKeyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the api keys for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogApiKeyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the api keys for a given monitor resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogApiKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceImpl.java new file mode 100644 index 0000000000000..5b34c18896e37 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogAgreementResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogAgreementProperties; + +class DatadogAgreementResourceImpl extends WrapperImpl implements DatadogAgreementResource { + private final DatadogManager manager; + + DatadogAgreementResourceImpl(DatadogAgreementResourceInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DatadogAgreementProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceInner.java new file mode 100644 index 0000000000000..7c1ffadee52a3 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogAgreementResourceInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogAgreementProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The DatadogAgreementResourceInner model. + */ +public class DatadogAgreementResourceInner extends ProxyResource { + /** + * Represents the properties of the resource. + */ + @JsonProperty(value = "properties") + private DatadogAgreementProperties properties; + + /** + * Get represents the properties of the resource. + * + * @return the properties value + */ + public DatadogAgreementProperties properties() { + return this.properties; + } + + /** + * Set represents the properties of the resource. + * + * @param properties the properties value to set + * @return the DatadogAgreementResourceInner object itself. + */ + public DatadogAgreementResourceInner withProperties(DatadogAgreementProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyImpl.java new file mode 100644 index 0000000000000..a45d9452debba --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogApiKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DatadogApiKeyImpl extends WrapperImpl implements DatadogApiKey { + private final DatadogManager manager; + DatadogApiKeyImpl(DatadogApiKeyInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public String created() { + return this.inner().created(); + } + + @Override + public String createdBy() { + return this.inner().createdBy(); + } + + @Override + public String keyVal() { + return this.inner().key(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyInner.java new file mode 100644 index 0000000000000..2533f307dfe6b --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogApiKeyInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogApiKeyInner model. + */ +public class DatadogApiKeyInner { + /** + * The user that created the API key. + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /** + * The name of the API key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the API key. + */ + @JsonProperty(value = "key", required = true) + private String key; + + /** + * The time of creation of the API key. + */ + @JsonProperty(value = "created") + private String created; + + /** + * Get the user that created the API key. + * + * @return the createdBy value + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the user that created the API key. + * + * @param createdBy the createdBy value to set + * @return the DatadogApiKeyInner object itself. + */ + public DatadogApiKeyInner withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the name of the API key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the API key. + * + * @param name the name value to set + * @return the DatadogApiKeyInner object itself. + */ + public DatadogApiKeyInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the API key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the value of the API key. + * + * @param key the key value to set + * @return the DatadogApiKeyInner object itself. + */ + public DatadogApiKeyInner withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the time of creation of the API key. + * + * @return the created value + */ + public String created() { + return this.created; + } + + /** + * Set the time of creation of the API key. + * + * @param created the created value to set + * @return the DatadogApiKeyInner object itself. + */ + public DatadogApiKeyInner withCreated(String created) { + this.created = created; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostImpl.java new file mode 100644 index 0000000000000..e4841819c48d7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogHost; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogHostMetadata; + +class DatadogHostImpl extends WrapperImpl implements DatadogHost { + private final DatadogManager manager; + DatadogHostImpl(DatadogHostInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public List aliases() { + return this.inner().aliases(); + } + + @Override + public List apps() { + return this.inner().apps(); + } + + @Override + public DatadogHostMetadata meta() { + return this.inner().meta(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostInner.java new file mode 100644 index 0000000000000..ea095a2ed5207 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogHostInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogHostMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogHostInner model. + */ +public class DatadogHostInner { + /** + * The name of the host. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The aliases for the host. + */ + @JsonProperty(value = "aliases") + private List aliases; + + /** + * The Datadog integrations reporting metrics for the host. + */ + @JsonProperty(value = "apps") + private List apps; + + /** + * The meta property. + */ + @JsonProperty(value = "meta") + private DatadogHostMetadata meta; + + /** + * Get the name of the host. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the host. + * + * @param name the name value to set + * @return the DatadogHostInner object itself. + */ + public DatadogHostInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the aliases for the host. + * + * @return the aliases value + */ + public List aliases() { + return this.aliases; + } + + /** + * Set the aliases for the host. + * + * @param aliases the aliases value to set + * @return the DatadogHostInner object itself. + */ + public DatadogHostInner withAliases(List aliases) { + this.aliases = aliases; + return this; + } + + /** + * Get the Datadog integrations reporting metrics for the host. + * + * @return the apps value + */ + public List apps() { + return this.apps; + } + + /** + * Set the Datadog integrations reporting metrics for the host. + * + * @param apps the apps value to set + * @return the DatadogHostInner object itself. + */ + public DatadogHostInner withApps(List apps) { + this.apps = apps; + return this; + } + + /** + * Get the meta value. + * + * @return the meta value + */ + public DatadogHostMetadata meta() { + return this.meta; + } + + /** + * Set the meta value. + * + * @param meta the meta value to set + * @return the DatadogHostInner object itself. + */ + public DatadogHostInner withMeta(DatadogHostMetadata meta) { + this.meta = meta; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogManager.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogManager.java new file mode 100644 index 0000000000000..3a82064291151 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogManager.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MarketplaceAgreements; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ApiKeys; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.Hosts; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.LinkedResources; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoredResources; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.Operations; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.RefreshSetPasswords; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.TagRules; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Datadog resource management. + */ +public final class DatadogManager extends ManagerCore { + private MarketplaceAgreements marketplaceAgreements; + private ApiKeys apiKeys; + private Hosts hosts; + private LinkedResources linkedResources; + private MonitoredResources monitoredResources; + private Operations operations; + private Monitors monitors; + private RefreshSetPasswords refreshSetPasswords; + private TagRules tagRules; + private SingleSignOnConfigurations singleSignOnConfigurations; + /** + * Get a Configurable instance that can be used to create DatadogManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DatadogManager.ConfigurableImpl(); + } + /** + * Creates an instance of DatadogManager that exposes Datadog resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DatadogManager + */ + public static DatadogManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DatadogManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DatadogManager that exposes Datadog resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DatadogManager + */ + public static DatadogManager authenticate(RestClient restClient, String subscriptionId) { + return new DatadogManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DatadogManager that exposes Datadog management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Datadog management API entry points that work across subscriptions + */ + DatadogManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage MarketplaceAgreements. + */ + public MarketplaceAgreements marketplaceAgreements() { + if (this.marketplaceAgreements == null) { + this.marketplaceAgreements = new MarketplaceAgreementsImpl(this); + } + return this.marketplaceAgreements; + } + + /** + * @return Entry point to manage ApiKeys. + */ + public ApiKeys apiKeys() { + if (this.apiKeys == null) { + this.apiKeys = new ApiKeysImpl(this); + } + return this.apiKeys; + } + + /** + * @return Entry point to manage Hosts. + */ + public Hosts hosts() { + if (this.hosts == null) { + this.hosts = new HostsImpl(this); + } + return this.hosts; + } + + /** + * @return Entry point to manage LinkedResources. + */ + public LinkedResources linkedResources() { + if (this.linkedResources == null) { + this.linkedResources = new LinkedResourcesImpl(this); + } + return this.linkedResources; + } + + /** + * @return Entry point to manage MonitoredResources. + */ + public MonitoredResources monitoredResources() { + if (this.monitoredResources == null) { + this.monitoredResources = new MonitoredResourcesImpl(this); + } + return this.monitoredResources; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Monitors. + */ + public Monitors monitors() { + if (this.monitors == null) { + this.monitors = new MonitorsImpl(this); + } + return this.monitors; + } + + /** + * @return Entry point to manage RefreshSetPasswords. + */ + public RefreshSetPasswords refreshSetPasswords() { + if (this.refreshSetPasswords == null) { + this.refreshSetPasswords = new RefreshSetPasswordsImpl(this); + } + return this.refreshSetPasswords; + } + + /** + * @return Entry point to manage TagRules. + */ + public TagRules tagRules() { + if (this.tagRules == null) { + this.tagRules = new TagRulesImpl(this); + } + return this.tagRules; + } + + /** + * @return Entry point to manage SingleSignOnConfigurations. + */ + public SingleSignOnConfigurations singleSignOnConfigurations() { + if (this.singleSignOnConfigurations == null) { + this.singleSignOnConfigurations = new SingleSignOnConfigurationsImpl(this); + } + return this.singleSignOnConfigurations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DatadogManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DatadogManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DatadogManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MicrosoftDatadogClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceImpl.java new file mode 100644 index 0000000000000..403f442ec7e40 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogMonitorResource; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogMonitorResourceUpdateParameters; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceSku; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitorProperties; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.IdentityProperties; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitorUpdateProperties; +import rx.functions.Func1; + +class DatadogMonitorResourceImpl extends GroupableResourceCoreImpl implements DatadogMonitorResource, DatadogMonitorResource.Definition, DatadogMonitorResource.Update { + private DatadogMonitorResourceUpdateParameters updateParameter; + DatadogMonitorResourceImpl(String name, DatadogMonitorResourceInner inner, DatadogManager manager) { + super(name, inner, manager); + this.updateParameter = new DatadogMonitorResourceUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + MonitorsInner client = this.manager().inner().monitors(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public DatadogMonitorResourceInner call(DatadogMonitorResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MonitorsInner client = this.manager().inner().monitors(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DatadogMonitorResourceInner call(DatadogMonitorResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MonitorsInner client = this.manager().inner().monitors(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new DatadogMonitorResourceUpdateParameters(); + } + + @Override + public IdentityProperties identity() { + return this.inner().identity(); + } + + @Override + public MonitorProperties properties() { + return this.inner().properties(); + } + + @Override + public ResourceSku sku() { + return this.inner().sku(); + } + + @Override + public DatadogMonitorResourceImpl withIdentity(IdentityProperties identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public DatadogMonitorResourceImpl withProperties(MonitorProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public DatadogMonitorResourceImpl withSku(ResourceSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public DatadogMonitorResourceImpl withProperties(MonitorUpdateProperties properties) { + this.updateParameter.withProperties(properties); + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceInner.java new file mode 100644 index 0000000000000..9bf93b34ab5d6 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogMonitorResourceInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceSku; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitorProperties; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.IdentityProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The DatadogMonitorResourceInner model. + */ +public class DatadogMonitorResourceInner extends Resource { + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private MonitorProperties properties; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * Get the sku value. + * + * @return the sku value + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the DatadogMonitorResourceInner object itself. + */ + public DatadogMonitorResourceInner withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public MonitorProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the DatadogMonitorResourceInner object itself. + */ + public DatadogMonitorResourceInner withProperties(MonitorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the DatadogMonitorResourceInner object itself. + */ + public DatadogMonitorResourceInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkImpl.java new file mode 100644 index 0000000000000..706dcf7451ec1 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSetPasswordLink; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DatadogSetPasswordLinkImpl extends WrapperImpl implements DatadogSetPasswordLink { + private final DatadogManager manager; + DatadogSetPasswordLinkImpl(DatadogSetPasswordLinkInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public String setPasswordLink() { + return this.inner().setPasswordLink(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkInner.java new file mode 100644 index 0000000000000..0ce40ccd1dd95 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSetPasswordLinkInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatadogSetPasswordLinkInner model. + */ +public class DatadogSetPasswordLinkInner { + /** + * The setPasswordLink property. + */ + @JsonProperty(value = "setPasswordLink") + private String setPasswordLink; + + /** + * Get the setPasswordLink value. + * + * @return the setPasswordLink value + */ + public String setPasswordLink() { + return this.setPasswordLink; + } + + /** + * Set the setPasswordLink value. + * + * @param setPasswordLink the setPasswordLink value to set + * @return the DatadogSetPasswordLinkInner object itself. + */ + public DatadogSetPasswordLinkInner withSetPasswordLink(String setPasswordLink) { + this.setPasswordLink = setPasswordLink; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceImpl.java new file mode 100644 index 0000000000000..7fb11f9663a72 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSingleSignOnResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSingleSignOnProperties; +import rx.functions.Func1; + +class DatadogSingleSignOnResourceImpl extends CreatableUpdatableImpl implements DatadogSingleSignOnResource, DatadogSingleSignOnResource.Definition, DatadogSingleSignOnResource.Update { + private final DatadogManager manager; + private String resourceGroupName; + private String monitorName; + private String configurationName; + private DatadogSingleSignOnProperties cproperties; + private DatadogSingleSignOnProperties uproperties; + + DatadogSingleSignOnResourceImpl(String name, DatadogManager manager) { + super(name, new DatadogSingleSignOnResourceInner()); + this.manager = manager; + // Set resource name + this.configurationName = name; + // + this.cproperties = new DatadogSingleSignOnProperties(); + this.uproperties = new DatadogSingleSignOnProperties(); + } + + DatadogSingleSignOnResourceImpl(DatadogSingleSignOnResourceInner inner, DatadogManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.configurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.monitorName = IdParsingUtils.getValueFromIdByName(inner.id(), "monitors"); + this.configurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "singleSignOnConfigurations"); + // + this.cproperties = new DatadogSingleSignOnProperties(); + this.uproperties = new DatadogSingleSignOnProperties(); + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SingleSignOnConfigurationsInner client = this.manager().inner().singleSignOnConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.monitorName, this.configurationName, this.cproperties) + .map(new Func1() { + @Override + public DatadogSingleSignOnResourceInner call(DatadogSingleSignOnResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SingleSignOnConfigurationsInner client = this.manager().inner().singleSignOnConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.monitorName, this.configurationName, this.uproperties) + .map(new Func1() { + @Override + public DatadogSingleSignOnResourceInner call(DatadogSingleSignOnResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SingleSignOnConfigurationsInner client = this.manager().inner().singleSignOnConfigurations(); + return client.getAsync(this.resourceGroupName, this.monitorName, this.configurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new DatadogSingleSignOnProperties(); + this.uproperties = new DatadogSingleSignOnProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DatadogSingleSignOnProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DatadogSingleSignOnResourceImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + @Override + public DatadogSingleSignOnResourceImpl withProperties(DatadogSingleSignOnProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceInner.java new file mode 100644 index 0000000000000..89082a341aa6d --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/DatadogSingleSignOnResourceInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSingleSignOnProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The DatadogSingleSignOnResourceInner model. + */ +public class DatadogSingleSignOnResourceInner extends ProxyResource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private DatadogSingleSignOnProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public DatadogSingleSignOnProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the DatadogSingleSignOnResourceInner object itself. + */ + public DatadogSingleSignOnResourceInner withProperties(DatadogSingleSignOnProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsImpl.java new file mode 100644 index 0000000000000..40efd3d6ff6b9 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.Hosts; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogHost; + +class HostsImpl extends WrapperImpl implements Hosts { + private final DatadogManager manager; + + HostsImpl(DatadogManager manager) { + super(manager.inner().hosts()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String monitorName) { + HostsInner client = this.inner(); + return client.listAsync(resourceGroupName, monitorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatadogHost call(DatadogHostInner inner) { + return new DatadogHostImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsInner.java new file mode 100644 index 0000000000000..256f7e9201774 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/HostsInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Hosts. + */ +public class HostsInner { + /** The Retrofit service to perform REST calls. */ + private HostsService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of HostsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HostsInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(HostsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Hosts to be + * used by Retrofit to perform actually REST calls. + */ + interface HostsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Hosts list" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Hosts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the hosts for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogHostInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String monitorName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, monitorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the hosts for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String monitorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, monitorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the hosts for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogHostInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String monitorName) { + return listWithServiceResponseAsync(resourceGroupName, monitorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the hosts for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogHostInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String monitorName) { + return listSinglePageAsync(resourceGroupName, monitorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the hosts for a given monitor resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + ServiceResponse> * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogHostInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List the hosts for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogHostInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the hosts for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the hosts for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogHostInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the hosts for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogHostInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the hosts for a given monitor resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogHostInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/IdParsingUtils.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..506d8b71b5a82 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceImpl.java new file mode 100644 index 0000000000000..47114bb5340e3 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.LinkedResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LinkedResourceImpl extends WrapperImpl implements LinkedResource { + private final DatadogManager manager; + LinkedResourceImpl(LinkedResourceInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceInner.java new file mode 100644 index 0000000000000..7210cc7fe7ff2 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourceInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a linked resource. + */ +public class LinkedResourceInner { + /** + * The ARM id of the linked resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ARM id of the linked resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ARM id of the linked resource. + * + * @param id the id value to set + * @return the LinkedResourceInner object itself. + */ + public LinkedResourceInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesImpl.java new file mode 100644 index 0000000000000..fbf8897c3a596 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.LinkedResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.LinkedResource; + +class LinkedResourcesImpl extends WrapperImpl implements LinkedResources { + private final DatadogManager manager; + + LinkedResourcesImpl(DatadogManager manager) { + super(manager.inner().linkedResources()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String monitorName) { + LinkedResourcesInner client = this.inner(); + return client.listAsync(resourceGroupName, monitorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LinkedResource call(LinkedResourceInner inner) { + return new LinkedResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesInner.java new file mode 100644 index 0000000000000..0902adbca643f --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/LinkedResourcesInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LinkedResources. + */ +public class LinkedResourcesInner { + /** The Retrofit service to perform REST calls. */ + private LinkedResourcesService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of LinkedResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LinkedResourcesInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(LinkedResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LinkedResources to be + * used by Retrofit to perform actually REST calls. + */ + interface LinkedResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.LinkedResources list" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.LinkedResources listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LinkedResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String monitorName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, monitorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String monitorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, monitorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LinkedResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String monitorName) { + return listWithServiceResponseAsync(resourceGroupName, monitorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LinkedResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String monitorName) { + return listSinglePageAsync(resourceGroupName, monitorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + ServiceResponse> * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LinkedResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LinkedResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LinkedResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LinkedResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all Azure resources associated to the same Datadog organization as the target resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LinkedResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsImpl.java new file mode 100644 index 0000000000000..4128c5de3f50c --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsImpl.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MarketplaceAgreements; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogAgreementResource; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class MarketplaceAgreementsImpl extends WrapperImpl implements MarketplaceAgreements { + private PagedListConverter converter; + private final DatadogManager manager; + + MarketplaceAgreementsImpl(DatadogManager manager) { + super(manager.inner().marketplaceAgreements()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(DatadogAgreementResourceInner inner) { + return Observable.just((DatadogAgreementResource) wrapModel(inner)); + } + }; + } + + public DatadogManager manager() { + return this.manager; + } + + private DatadogAgreementResourceImpl wrapModel(DatadogAgreementResourceInner inner) { + return new DatadogAgreementResourceImpl(inner, manager()); + } + + @Override + public Observable createAsync() { + MarketplaceAgreementsInner client = this.inner(); + return client.createAsync() + .map(new Func1() { + @Override + public DatadogAgreementResource call(DatadogAgreementResourceInner inner) { + return new DatadogAgreementResourceImpl(inner, manager()); + } + }); + } + + @Override + public PagedList list() { + MarketplaceAgreementsInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + MarketplaceAgreementsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatadogAgreementResource call(DatadogAgreementResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsInner.java new file mode 100644 index 0000000000000..54c09055e3272 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MarketplaceAgreementsInner.java @@ -0,0 +1,436 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogAgreementProperties; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MarketplaceAgreements. + */ +public class MarketplaceAgreementsInner { + /** The Retrofit service to perform REST calls. */ + private MarketplaceAgreementsService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of MarketplaceAgreementsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MarketplaceAgreementsInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(MarketplaceAgreementsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MarketplaceAgreements to be + * used by Retrofit to perform actually REST calls. + */ + interface MarketplaceAgreementsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.MarketplaceAgreements list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements") + Observable> list(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.MarketplaceAgreements create" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default") + Observable> create(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Body DatadogAgreementResourceInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.MarketplaceAgreements listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogAgreementResourceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogAgreementResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogAgreementResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogAgreementResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogAgreementResourceInner object if successful. + */ + public DatadogAgreementResourceInner create() { + return createWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(), serviceCallback); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogAgreementResourceInner object + */ + public Observable createAsync() { + return createWithServiceResponseAsync().map(new Func1, DatadogAgreementResourceInner>() { + @Override + public DatadogAgreementResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogAgreementResourceInner object + */ + public Observable> createWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final DatadogAgreementProperties properties = null; + DatadogAgreementResourceInner body = new DatadogAgreementResourceInner(); + body.withProperties(null); + return service.create(this.client.subscriptionId(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @param properties Represents the properties of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogAgreementResourceInner object if successful. + */ + public DatadogAgreementResourceInner create(DatadogAgreementProperties properties) { + return createWithServiceResponseAsync(properties).toBlocking().single().body(); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @param properties Represents the properties of the resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(DatadogAgreementProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(properties), serviceCallback); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @param properties Represents the properties of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogAgreementResourceInner object + */ + public Observable createAsync(DatadogAgreementProperties properties) { + return createWithServiceResponseAsync(properties).map(new Func1, DatadogAgreementResourceInner>() { + @Override + public DatadogAgreementResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Datadog marketplace agreement in the subscription. + * + * @param properties Represents the properties of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogAgreementResourceInner object + */ + public Observable> createWithServiceResponseAsync(DatadogAgreementProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(properties); + DatadogAgreementResourceInner body = null; + if (properties != null) { + body = new DatadogAgreementResourceInner(); + body.withProperties(properties); + } + return service.create(this.client.subscriptionId(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogAgreementResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogAgreementResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogAgreementResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Datadog marketplace agreements in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogAgreementResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MicrosoftDatadogClientImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MicrosoftDatadogClientImpl.java new file mode 100644 index 0000000000000..03028885a7a61 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MicrosoftDatadogClientImpl.java @@ -0,0 +1,322 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MicrosoftDatadogClientImpl class. + */ +public class MicrosoftDatadogClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftDatadogClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MicrosoftDatadogClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MicrosoftDatadogClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MicrosoftDatadogClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The MarketplaceAgreementsInner object to access its operations. + */ + private MarketplaceAgreementsInner marketplaceAgreements; + + /** + * Gets the MarketplaceAgreementsInner object to access its operations. + * @return the MarketplaceAgreementsInner object. + */ + public MarketplaceAgreementsInner marketplaceAgreements() { + return this.marketplaceAgreements; + } + + /** + * The ApiKeysInner object to access its operations. + */ + private ApiKeysInner apiKeys; + + /** + * Gets the ApiKeysInner object to access its operations. + * @return the ApiKeysInner object. + */ + public ApiKeysInner apiKeys() { + return this.apiKeys; + } + + /** + * The HostsInner object to access its operations. + */ + private HostsInner hosts; + + /** + * Gets the HostsInner object to access its operations. + * @return the HostsInner object. + */ + public HostsInner hosts() { + return this.hosts; + } + + /** + * The LinkedResourcesInner object to access its operations. + */ + private LinkedResourcesInner linkedResources; + + /** + * Gets the LinkedResourcesInner object to access its operations. + * @return the LinkedResourcesInner object. + */ + public LinkedResourcesInner linkedResources() { + return this.linkedResources; + } + + /** + * The MonitoredResourcesInner object to access its operations. + */ + private MonitoredResourcesInner monitoredResources; + + /** + * Gets the MonitoredResourcesInner object to access its operations. + * @return the MonitoredResourcesInner object. + */ + public MonitoredResourcesInner monitoredResources() { + return this.monitoredResources; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The MonitorsInner object to access its operations. + */ + private MonitorsInner monitors; + + /** + * Gets the MonitorsInner object to access its operations. + * @return the MonitorsInner object. + */ + public MonitorsInner monitors() { + return this.monitors; + } + + /** + * The RefreshSetPasswordsInner object to access its operations. + */ + private RefreshSetPasswordsInner refreshSetPasswords; + + /** + * Gets the RefreshSetPasswordsInner object to access its operations. + * @return the RefreshSetPasswordsInner object. + */ + public RefreshSetPasswordsInner refreshSetPasswords() { + return this.refreshSetPasswords; + } + + /** + * The TagRulesInner object to access its operations. + */ + private TagRulesInner tagRules; + + /** + * Gets the TagRulesInner object to access its operations. + * @return the TagRulesInner object. + */ + public TagRulesInner tagRules() { + return this.tagRules; + } + + /** + * The SingleSignOnConfigurationsInner object to access its operations. + */ + private SingleSignOnConfigurationsInner singleSignOnConfigurations; + + /** + * Gets the SingleSignOnConfigurationsInner object to access its operations. + * @return the SingleSignOnConfigurationsInner object. + */ + public SingleSignOnConfigurationsInner singleSignOnConfigurations() { + return this.singleSignOnConfigurations; + } + + /** + * Initializes an instance of MicrosoftDatadogClient client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftDatadogClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MicrosoftDatadogClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftDatadogClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftDatadogClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftDatadogClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-02-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.marketplaceAgreements = new MarketplaceAgreementsInner(restClient().retrofit(), this); + this.apiKeys = new ApiKeysInner(restClient().retrofit(), this); + this.hosts = new HostsInner(restClient().retrofit(), this); + this.linkedResources = new LinkedResourcesInner(restClient().retrofit(), this); + this.monitoredResources = new MonitoredResourcesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.monitors = new MonitorsInner(restClient().retrofit(), this); + this.refreshSetPasswords = new RefreshSetPasswordsInner(restClient().retrofit(), this); + this.tagRules = new TagRulesInner(restClient().retrofit(), this); + this.singleSignOnConfigurations = new SingleSignOnConfigurationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "MicrosoftDatadogClient", "2020-02-01-preview"); + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceImpl.java new file mode 100644 index 0000000000000..52f199e9547f7 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoredResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class MonitoredResourceImpl extends WrapperImpl implements MonitoredResource { + private final DatadogManager manager; + MonitoredResourceImpl(MonitoredResourceInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String reasonForLogsStatus() { + return this.inner().reasonForLogsStatus(); + } + + @Override + public String reasonForMetricsStatus() { + return this.inner().reasonForMetricsStatus(); + } + + @Override + public Boolean sendingLogs() { + return this.inner().sendingLogs(); + } + + @Override + public Boolean sendingMetrics() { + return this.inner().sendingMetrics(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceInner.java new file mode 100644 index 0000000000000..b116520f644f1 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourceInner.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a resource currently being monitored by the Datadog + * monitor resource. + */ +public class MonitoredResourceInner { + /** + * The ARM id of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Flag indicating if resource is sending metrics to Datadog. + */ + @JsonProperty(value = "sendingMetrics") + private Boolean sendingMetrics; + + /** + * Reason for why the resource is sending metrics (or why it is not + * sending). + */ + @JsonProperty(value = "reasonForMetricsStatus") + private String reasonForMetricsStatus; + + /** + * Flag indicating if resource is sending logs to Datadog. + */ + @JsonProperty(value = "sendingLogs") + private Boolean sendingLogs; + + /** + * Reason for why the resource is sending logs (or why it is not sending). + */ + @JsonProperty(value = "reasonForLogsStatus") + private String reasonForLogsStatus; + + /** + * Get the ARM id of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ARM id of the resource. + * + * @param id the id value to set + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get flag indicating if resource is sending metrics to Datadog. + * + * @return the sendingMetrics value + */ + public Boolean sendingMetrics() { + return this.sendingMetrics; + } + + /** + * Set flag indicating if resource is sending metrics to Datadog. + * + * @param sendingMetrics the sendingMetrics value to set + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withSendingMetrics(Boolean sendingMetrics) { + this.sendingMetrics = sendingMetrics; + return this; + } + + /** + * Get reason for why the resource is sending metrics (or why it is not sending). + * + * @return the reasonForMetricsStatus value + */ + public String reasonForMetricsStatus() { + return this.reasonForMetricsStatus; + } + + /** + * Set reason for why the resource is sending metrics (or why it is not sending). + * + * @param reasonForMetricsStatus the reasonForMetricsStatus value to set + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withReasonForMetricsStatus(String reasonForMetricsStatus) { + this.reasonForMetricsStatus = reasonForMetricsStatus; + return this; + } + + /** + * Get flag indicating if resource is sending logs to Datadog. + * + * @return the sendingLogs value + */ + public Boolean sendingLogs() { + return this.sendingLogs; + } + + /** + * Set flag indicating if resource is sending logs to Datadog. + * + * @param sendingLogs the sendingLogs value to set + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withSendingLogs(Boolean sendingLogs) { + this.sendingLogs = sendingLogs; + return this; + } + + /** + * Get reason for why the resource is sending logs (or why it is not sending). + * + * @return the reasonForLogsStatus value + */ + public String reasonForLogsStatus() { + return this.reasonForLogsStatus; + } + + /** + * Set reason for why the resource is sending logs (or why it is not sending). + * + * @param reasonForLogsStatus the reasonForLogsStatus value to set + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withReasonForLogsStatus(String reasonForLogsStatus) { + this.reasonForLogsStatus = reasonForLogsStatus; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesImpl.java new file mode 100644 index 0000000000000..1d10f35ad8619 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoredResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoredResource; + +class MonitoredResourcesImpl extends WrapperImpl implements MonitoredResources { + private final DatadogManager manager; + + MonitoredResourcesImpl(DatadogManager manager) { + super(manager.inner().monitoredResources()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String monitorName) { + MonitoredResourcesInner client = this.inner(); + return client.listAsync(resourceGroupName, monitorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MonitoredResource call(MonitoredResourceInner inner) { + return new MonitoredResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesInner.java new file mode 100644 index 0000000000000..d07dcc3f2ea2a --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoredResourcesInner.java @@ -0,0 +1,304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MonitoredResources. + */ +public class MonitoredResourcesInner { + /** The Retrofit service to perform REST calls. */ + private MonitoredResourcesService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of MonitoredResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MonitoredResourcesInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(MonitoredResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MonitoredResources to be + * used by Retrofit to perform actually REST calls. + */ + interface MonitoredResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoredResources list" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoredResources listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MonitoredResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String monitorName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, monitorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String monitorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, monitorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoredResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String monitorName) { + return listWithServiceResponseAsync(resourceGroupName, monitorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoredResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String monitorName) { + return listSinglePageAsync(resourceGroupName, monitorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + ServiceResponse> * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MonitoredResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MonitoredResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoredResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoredResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the resources currently being monitored by the Datadog monitor resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MonitoredResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesImpl.java new file mode 100644 index 0000000000000..84c4009bdc7cc --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoringTagRules; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoringTagRulesProperties; +import rx.functions.Func1; + +class MonitoringTagRulesImpl extends CreatableUpdatableImpl implements MonitoringTagRules, MonitoringTagRules.Definition, MonitoringTagRules.Update { + private final DatadogManager manager; + private String resourceGroupName; + private String monitorName; + private String ruleSetName; + private MonitoringTagRulesProperties cproperties; + private MonitoringTagRulesProperties uproperties; + + MonitoringTagRulesImpl(String name, DatadogManager manager) { + super(name, new MonitoringTagRulesInner()); + this.manager = manager; + // Set resource name + this.ruleSetName = name; + // + this.cproperties = new MonitoringTagRulesProperties(); + this.uproperties = new MonitoringTagRulesProperties(); + } + + MonitoringTagRulesImpl(MonitoringTagRulesInner inner, DatadogManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.ruleSetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.monitorName = IdParsingUtils.getValueFromIdByName(inner.id(), "monitors"); + this.ruleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "tagRules"); + // + this.cproperties = new MonitoringTagRulesProperties(); + this.uproperties = new MonitoringTagRulesProperties(); + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TagRulesInner client = this.manager().inner().tagRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.monitorName, this.ruleSetName, this.cproperties) + .map(new Func1() { + @Override + public MonitoringTagRulesInner call(MonitoringTagRulesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TagRulesInner client = this.manager().inner().tagRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.monitorName, this.ruleSetName, this.uproperties) + .map(new Func1() { + @Override + public MonitoringTagRulesInner call(MonitoringTagRulesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TagRulesInner client = this.manager().inner().tagRules(); + return client.getAsync(this.resourceGroupName, this.monitorName, this.ruleSetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new MonitoringTagRulesProperties(); + this.uproperties = new MonitoringTagRulesProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public MonitoringTagRulesProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public MonitoringTagRulesImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + @Override + public MonitoringTagRulesImpl withProperties(MonitoringTagRulesProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesInner.java new file mode 100644 index 0000000000000..87d48574e7c65 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitoringTagRulesInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoringTagRulesProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Capture logs and metrics of Azure resources based on ARM tags. + */ +public class MonitoringTagRulesInner extends ProxyResource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private MonitoringTagRulesProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public MonitoringTagRulesProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the MonitoringTagRulesInner object itself. + */ + public MonitoringTagRulesInner withProperties(MonitoringTagRulesProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsImpl.java new file mode 100644 index 0000000000000..1d9a0c25d416a --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogMonitorResource; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class MonitorsImpl extends GroupableResourcesCoreImpl implements Monitors { + protected MonitorsImpl(DatadogManager manager) { + super(manager.inner().monitors(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + MonitorsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + MonitorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + MonitorsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + MonitorsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatadogMonitorResource call(DatadogMonitorResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + MonitorsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + MonitorsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatadogMonitorResource call(DatadogMonitorResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DatadogMonitorResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DatadogMonitorResourceImpl wrapModel(DatadogMonitorResourceInner inner) { + return new DatadogMonitorResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected DatadogMonitorResourceImpl wrapModel(String name) { + return new DatadogMonitorResourceImpl(name, new DatadogMonitorResourceInner(), this.manager()); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsInner.java new file mode 100644 index 0000000000000..952024b57fbb0 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/MonitorsInner.java @@ -0,0 +1,1282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogMonitorResourceUpdateParameters; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Monitors. + */ +public class MonitorsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private MonitorsService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of MonitorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MonitorsInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(MonitorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Monitors to be + * used by Retrofit to perform actually REST calls. + */ + interface MonitorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Body DatadogMonitorResourceInner body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Body DatadogMonitorResourceInner body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Body DatadogMonitorResourceUpdateParameters body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Monitors listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all monitors under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogMonitorResourceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all monitors under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all monitors under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all monitors under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all monitors under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogMonitorResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List all monitors under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogMonitorResourceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all monitors under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all monitors under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all monitors under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all monitors under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogMonitorResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Get the properties of a specific monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Get the properties of a specific monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Get the properties of a specific monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String monitorName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of a specific monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner create(String resourceGroupName, String monitorName) { + return createWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().last().body(); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String monitorName) { + return createWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final DatadogMonitorResourceInner body = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner create(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body) { + return createWithServiceResponseAsync(resourceGroupName, monitorName, body).toBlocking().last().body(); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, monitorName, body), serviceCallback); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body) { + return createWithServiceResponseAsync(resourceGroupName, monitorName, body).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner beginCreate(String resourceGroupName, String monitorName) { + return beginCreateWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String monitorName) { + return beginCreateWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final DatadogMonitorResourceInner body = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner beginCreate(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body) { + return beginCreateWithServiceResponseAsync(resourceGroupName, monitorName, body).toBlocking().single().body(); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, monitorName, body), serviceCallback); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body) { + return beginCreateWithServiceResponseAsync(resourceGroupName, monitorName, body).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner update(String resourceGroupName, String monitorName) { + return updateWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable updateAsync(String resourceGroupName, String monitorName) { + return updateWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final DatadogMonitorResourceUpdateParameters body = null; + return service.update(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceUpdateParameters value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogMonitorResourceInner object if successful. + */ + public DatadogMonitorResourceInner update(String resourceGroupName, String monitorName, DatadogMonitorResourceUpdateParameters body) { + return updateWithServiceResponseAsync(resourceGroupName, monitorName, body).toBlocking().single().body(); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceUpdateParameters value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceUpdateParameters body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, monitorName, body), serviceCallback); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceUpdateParameters value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable updateAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceUpdateParameters body) { + return updateWithServiceResponseAsync(resourceGroupName, monitorName, body).map(new Func1, DatadogMonitorResourceInner>() { + @Override + public DatadogMonitorResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param body the DatadogMonitorResourceUpdateParameters value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogMonitorResourceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String monitorName, DatadogMonitorResourceUpdateParameters body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.update(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String monitorName) { + deleteWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().last().body(); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String monitorName) { + return deleteWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String monitorName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String monitorName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List all monitors under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogMonitorResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all monitors under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all monitors under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all monitors under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all monitors under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogMonitorResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List all monitors under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogMonitorResourceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all monitors under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all monitors under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all monitors under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogMonitorResourceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all monitors under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogMonitorResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultImpl.java new file mode 100644 index 0000000000000..2900f446595c6 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.OperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.OperationDisplay; + +class OperationResultImpl extends WrapperImpl implements OperationResult { + private final DatadogManager manager; + OperationResultImpl(OperationResultInner inner, DatadogManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DatadogManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultInner.java new file mode 100644 index 0000000000000..734c22bf8a721 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationResultInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.management.datadog.v2020_02_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A Microsoft.Datadog REST API operation. + */ +public class OperationResultInner { + /** + * Operation name, i.e., {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display property. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Indicates whether the operation is a data action. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get operation name, i.e., {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name, i.e., {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get indicates whether the operation is a data action. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..8dd55dad5cd11 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.OperationResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DatadogManager manager; + + OperationsImpl(DatadogManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationResult call(OperationResultInner inner) { + return new OperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..d0274304ad588 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Operations list" }) + @GET("providers/Microsoft.Datadog/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationResultInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationResultInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all operations provided by Microsoft.Datadog for the 2020-02-01-preview api version. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/PageImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..b33ee27724941 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsImpl.java new file mode 100644 index 0000000000000..22aa94a249969 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.RefreshSetPasswords; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSetPasswordLink; + +class RefreshSetPasswordsImpl extends WrapperImpl implements RefreshSetPasswords { + private final DatadogManager manager; + + RefreshSetPasswordsImpl(DatadogManager manager) { + super(manager.inner().refreshSetPasswords()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String monitorName) { + RefreshSetPasswordsInner client = this.inner(); + return client.getAsync(resourceGroupName, monitorName) + .map(new Func1() { + @Override + public DatadogSetPasswordLink call(DatadogSetPasswordLinkInner inner) { + return new DatadogSetPasswordLinkImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsInner.java new file mode 100644 index 0000000000000..b4cf36c297b82 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/RefreshSetPasswordsInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RefreshSetPasswords. + */ +public class RefreshSetPasswordsInner { + /** The Retrofit service to perform REST calls. */ + private RefreshSetPasswordsService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of RefreshSetPasswordsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RefreshSetPasswordsInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(RefreshSetPasswordsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RefreshSetPasswords to be + * used by Retrofit to perform actually REST calls. + */ + interface RefreshSetPasswordsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.RefreshSetPasswords get" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Refresh the set password link and return a latest one. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogSetPasswordLinkInner object if successful. + */ + public DatadogSetPasswordLinkInner get(String resourceGroupName, String monitorName) { + return getWithServiceResponseAsync(resourceGroupName, monitorName).toBlocking().single().body(); + } + + /** + * Refresh the set password link and return a latest one. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String monitorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, monitorName), serviceCallback); + } + + /** + * Refresh the set password link and return a latest one. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSetPasswordLinkInner object + */ + public Observable getAsync(String resourceGroupName, String monitorName) { + return getWithServiceResponseAsync(resourceGroupName, monitorName).map(new Func1, DatadogSetPasswordLinkInner>() { + @Override + public DatadogSetPasswordLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Refresh the set password link and return a latest one. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSetPasswordLinkInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsImpl.java new file mode 100644 index 0000000000000..9a17eb1d991ae --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSingleSignOnResource; + +class SingleSignOnConfigurationsImpl extends WrapperImpl implements SingleSignOnConfigurations { + private final DatadogManager manager; + + SingleSignOnConfigurationsImpl(DatadogManager manager) { + super(manager.inner().singleSignOnConfigurations()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public DatadogSingleSignOnResourceImpl define(String name) { + return wrapModel(name); + } + + private DatadogSingleSignOnResourceImpl wrapModel(DatadogSingleSignOnResourceInner inner) { + return new DatadogSingleSignOnResourceImpl(inner, manager()); + } + + private DatadogSingleSignOnResourceImpl wrapModel(String name) { + return new DatadogSingleSignOnResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String monitorName) { + SingleSignOnConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, monitorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatadogSingleSignOnResource call(DatadogSingleSignOnResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String monitorName, String configurationName) { + SingleSignOnConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, monitorName, configurationName) + .flatMap(new Func1>() { + @Override + public Observable call(DatadogSingleSignOnResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DatadogSingleSignOnResource)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsInner.java new file mode 100644 index 0000000000000..0480f99b7aba2 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/SingleSignOnConfigurationsInner.java @@ -0,0 +1,770 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.DatadogSingleSignOnProperties; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SingleSignOnConfigurations. + */ +public class SingleSignOnConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private SingleSignOnConfigurationsService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of SingleSignOnConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SingleSignOnConfigurationsInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(SingleSignOnConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SingleSignOnConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface SingleSignOnConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatadogSingleSignOnResourceInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatadogSingleSignOnResourceInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.SingleSignOnConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogSingleSignOnResourceInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String monitorName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, monitorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String monitorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, monitorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogSingleSignOnResourceInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String monitorName) { + return listWithServiceResponseAsync(resourceGroupName, monitorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogSingleSignOnResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String monitorName) { + return listSinglePageAsync(resourceGroupName, monitorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + ServiceResponse> * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogSingleSignOnResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogSingleSignOnResourceInner object if successful. + */ + public DatadogSingleSignOnResourceInner createOrUpdate(String resourceGroupName, String monitorName, String configurationName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName).toBlocking().last().body(); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName), serviceCallback); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName).map(new Func1, DatadogSingleSignOnResourceInner>() { + @Override + public DatadogSingleSignOnResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String monitorName, String configurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final DatadogSingleSignOnProperties properties = null; + DatadogSingleSignOnResourceInner body = new DatadogSingleSignOnResourceInner(); + body.withProperties(null); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, monitorName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogSingleSignOnResourceInner object if successful. + */ + public DatadogSingleSignOnResourceInner createOrUpdate(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName, properties).toBlocking().last().body(); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName, properties), serviceCallback); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName, properties).map(new Func1, DatadogSingleSignOnResourceInner>() { + @Override + public DatadogSingleSignOnResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + DatadogSingleSignOnResourceInner body = null; + if (properties != null) { + body = new DatadogSingleSignOnResourceInner(); + body.withProperties(properties); + } + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, monitorName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogSingleSignOnResourceInner object if successful. + */ + public DatadogSingleSignOnResourceInner beginCreateOrUpdate(String resourceGroupName, String monitorName, String configurationName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName).toBlocking().single().body(); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName), serviceCallback); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSingleSignOnResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName).map(new Func1, DatadogSingleSignOnResourceInner>() { + @Override + public DatadogSingleSignOnResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSingleSignOnResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String monitorName, String configurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final DatadogSingleSignOnProperties properties = null; + DatadogSingleSignOnResourceInner body = new DatadogSingleSignOnResourceInner(); + body.withProperties(null); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, monitorName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogSingleSignOnResourceInner object if successful. + */ + public DatadogSingleSignOnResourceInner beginCreateOrUpdate(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName, properties).toBlocking().single().body(); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName, properties), serviceCallback); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSingleSignOnResourceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, configurationName, properties).map(new Func1, DatadogSingleSignOnResourceInner>() { + @Override + public DatadogSingleSignOnResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures single-sign-on for this resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param properties the DatadogSingleSignOnProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSingleSignOnResourceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String monitorName, String configurationName, DatadogSingleSignOnProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + DatadogSingleSignOnResourceInner body = null; + if (properties != null) { + body = new DatadogSingleSignOnResourceInner(); + body.withProperties(properties); + } + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, monitorName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Gets the datadog single sign-on resource for the given Monitor. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatadogSingleSignOnResourceInner object if successful. + */ + public DatadogSingleSignOnResourceInner get(String resourceGroupName, String monitorName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, monitorName, configurationName).toBlocking().single().body(); + } + + /** + * Gets the datadog single sign-on resource for the given Monitor. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String monitorName, String configurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, monitorName, configurationName), serviceCallback); + } + + /** + * Gets the datadog single sign-on resource for the given Monitor. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSingleSignOnResourceInner object + */ + public Observable getAsync(String resourceGroupName, String monitorName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, monitorName, configurationName).map(new Func1, DatadogSingleSignOnResourceInner>() { + @Override + public DatadogSingleSignOnResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the datadog single sign-on resource for the given Monitor. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param configurationName Configuration name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatadogSingleSignOnResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String monitorName, String configurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, monitorName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DatadogSingleSignOnResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogSingleSignOnResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatadogSingleSignOnResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the single sign-on configurations for a given monitor resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatadogSingleSignOnResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesImpl.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesImpl.java new file mode 100644 index 0000000000000..cce0c9bd86bf2 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.TagRules; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoringTagRules; + +class TagRulesImpl extends WrapperImpl implements TagRules { + private final DatadogManager manager; + + TagRulesImpl(DatadogManager manager) { + super(manager.inner().tagRules()); + this.manager = manager; + } + + public DatadogManager manager() { + return this.manager; + } + + @Override + public MonitoringTagRulesImpl define(String name) { + return wrapModel(name); + } + + private MonitoringTagRulesImpl wrapModel(MonitoringTagRulesInner inner) { + return new MonitoringTagRulesImpl(inner, manager()); + } + + private MonitoringTagRulesImpl wrapModel(String name) { + return new MonitoringTagRulesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String monitorName) { + TagRulesInner client = this.inner(); + return client.listAsync(resourceGroupName, monitorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MonitoringTagRules call(MonitoringTagRulesInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String monitorName, String ruleSetName) { + TagRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, monitorName, ruleSetName) + .flatMap(new Func1>() { + @Override + public Observable call(MonitoringTagRulesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MonitoringTagRules)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesInner.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesInner.java new file mode 100644 index 0000000000000..c82a1d9024157 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/TagRulesInner.java @@ -0,0 +1,601 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.MonitoringTagRulesProperties; +import com.microsoft.azure.management.datadog.v2020_02_01_preview.ResourceProviderDefaultErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TagRules. + */ +public class TagRulesInner { + /** The Retrofit service to perform REST calls. */ + private TagRulesService service; + /** The service client containing this operation class. */ + private MicrosoftDatadogClientImpl client; + + /** + * Initializes an instance of TagRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TagRulesInner(Retrofit retrofit, MicrosoftDatadogClientImpl client) { + this.service = retrofit.create(TagRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for TagRules to be + * used by Retrofit to perform actually REST calls. + */ + interface TagRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.TagRules list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.TagRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Path("ruleSetName") String ruleSetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MonitoringTagRulesInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.TagRules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("monitorName") String monitorName, @Path("ruleSetName") String ruleSetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.datadog.v2020_02_01_preview.TagRules listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the tag rules for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MonitoringTagRulesInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String monitorName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, monitorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the tag rules for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String monitorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, monitorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the tag rules for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoringTagRulesInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String monitorName) { + return listWithServiceResponseAsync(resourceGroupName, monitorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the tag rules for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoringTagRulesInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String monitorName) { + return listSinglePageAsync(resourceGroupName, monitorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the tag rules for a given monitor resource. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + ServiceResponse> * @param monitorName Monitor resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MonitoringTagRulesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String monitorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, monitorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MonitoringTagRulesInner object if successful. + */ + public MonitoringTagRulesInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName).toBlocking().single().body(); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName), serviceCallback); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringTagRulesInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName).map(new Func1, MonitoringTagRulesInner>() { + @Override + public MonitoringTagRulesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringTagRulesInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String monitorName, String ruleSetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (ruleSetName == null) { + throw new IllegalArgumentException("Parameter ruleSetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final MonitoringTagRulesProperties properties = null; + MonitoringTagRulesInner body = new MonitoringTagRulesInner(); + body.withProperties(null); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, monitorName, ruleSetName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @param properties the MonitoringTagRulesProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MonitoringTagRulesInner object if successful. + */ + public MonitoringTagRulesInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, MonitoringTagRulesProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName, properties).toBlocking().single().body(); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @param properties the MonitoringTagRulesProperties value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName, MonitoringTagRulesProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName, properties), serviceCallback); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @param properties the MonitoringTagRulesProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringTagRulesInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName, MonitoringTagRulesProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName, properties).map(new Func1, MonitoringTagRulesInner>() { + @Override + public MonitoringTagRulesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @param properties the MonitoringTagRulesProperties value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringTagRulesInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String monitorName, String ruleSetName, MonitoringTagRulesProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (ruleSetName == null) { + throw new IllegalArgumentException("Parameter ruleSetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + MonitoringTagRulesInner body = null; + if (properties != null) { + body = new MonitoringTagRulesInner(); + body.withProperties(properties); + } + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, monitorName, ruleSetName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * Get a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MonitoringTagRulesInner object if successful. + */ + public MonitoringTagRulesInner get(String resourceGroupName, String monitorName, String ruleSetName) { + return getWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName).toBlocking().single().body(); + } + + /** + * Get a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String monitorName, String ruleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName), serviceCallback); + } + + /** + * Get a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringTagRulesInner object + */ + public Observable getAsync(String resourceGroupName, String monitorName, String ruleSetName) { + return getWithServiceResponseAsync(resourceGroupName, monitorName, ruleSetName).map(new Func1, MonitoringTagRulesInner>() { + @Override + public MonitoringTagRulesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a tag rule set for a given monitor resource. + * + * @param resourceGroupName The name of the resource group to which the Datadog resource belongs. + * @param monitorName Monitor resource name + * @param ruleSetName Rule set name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MonitoringTagRulesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String monitorName, String ruleSetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (monitorName == null) { + throw new IllegalArgumentException("Parameter monitorName is required and cannot be null."); + } + if (ruleSetName == null) { + throw new IllegalArgumentException("Parameter ruleSetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, monitorName, ruleSetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + + /** + * List the tag rules for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ResourceProviderDefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MonitoringTagRulesInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the tag rules for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the tag rules for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoringTagRulesInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the tag rules for a given monitor resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MonitoringTagRulesInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the tag rules for a given monitor resource. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MonitoringTagRulesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ResourceProviderDefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ResourceProviderDefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ResourceProviderDefaultErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/package-info.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..2d91c623117e1 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for MicrosoftDatadogClient. + */ +package com.microsoft.azure.management.datadog.v2020_02_01_preview.implementation; diff --git a/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/package-info.java b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/package-info.java new file mode 100644 index 0000000000000..fe900e47859f0 --- /dev/null +++ b/sdk/datadog/mgmt-v2020_02_01_preview/src/main/java/com/microsoft/azure/management/datadog/v2020_02_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for MicrosoftDatadogClient. + */ +package com.microsoft.azure.management.datadog.v2020_02_01_preview;