diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e87862c74dc6..3af2315ec3ac 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -340,6 +340,7 @@ com.azure.resourcemanager:azure-resourcemanager-servicelinker;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-scvmm;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hardwaresecuritymodules;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index b1f52a5607a6..7018e227300d 100644 --- a/pom.xml +++ b/pom.xml @@ -893,6 +893,7 @@ sdk/devtestlabs sdk/digitaltwins sdk/dnsresolver + sdk/dynatrace sdk/edgeorder sdk/elastic sdk/eventgrid diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/CHANGELOG.md b/sdk/dynatrace/azure-resourcemanager-dynatrace/CHANGELOG.md new file mode 100644 index 000000000000..b1ea89cd5c5e --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-05-10) + +- Azure Resource Manager Dynatrace client library for Java. This package contains Microsoft Azure SDK for Dynatrace Management SDK. Package tag package-2021-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/README.md b/sdk/dynatrace/azure-resourcemanager-dynatrace/README.md new file mode 100644 index 000000000000..e39a9b8b469d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Dynatrace client library for Java + +Azure Resource Manager Dynatrace client library for Java. + +This package contains Microsoft Azure SDK for Dynatrace Management SDK. Package tag package-2021-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-dynatrace;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-dynatrace + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +DynatraceManager manager = DynatraceManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/dynatrace/azure-resourcemanager-dynatrace/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/SAMPLE.md b/sdk/dynatrace/azure-resourcemanager-dynatrace/SAMPLE.md new file mode 100644 index 000000000000..cd99711eb420 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/SAMPLE.md @@ -0,0 +1,1001 @@ +# Code snippets and samples + + +## Monitors + +- [CreateOrUpdate](#monitors_createorupdate) +- [Delete](#monitors_delete) +- [GetAccountCredentials](#monitors_getaccountcredentials) +- [GetByResourceGroup](#monitors_getbyresourcegroup) +- [GetSsoDetails](#monitors_getssodetails) +- [GetVMHostPayload](#monitors_getvmhostpayload) +- [List](#monitors_list) +- [ListAppServices](#monitors_listappservices) +- [ListByResourceGroup](#monitors_listbyresourcegroup) +- [ListHosts](#monitors_listhosts) +- [ListLinkableEnvironments](#monitors_listlinkableenvironments) +- [ListMonitoredResources](#monitors_listmonitoredresources) +- [Update](#monitors_update) + +## Operations + +- [List](#operations_list) + +## SingleSignOn + +- [CreateOrUpdate](#singlesignon_createorupdate) +- [Get](#singlesignon_get) +- [List](#singlesignon_list) + +## TagRules + +- [CreateOrUpdate](#tagrules_createorupdate) +- [Delete](#tagrules_delete) +- [Get](#tagrules_get) +- [List](#tagrules_list) +- [Update](#tagrules_update) +### Monitors_CreateOrUpdate + +```java +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnProperties; +import com.azure.resourcemanager.dynatrace.models.AccountInfo; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.EnvironmentInfo; +import com.azure.resourcemanager.dynatrace.models.IdentityProperties; +import com.azure.resourcemanager.dynatrace.models.ManagedIdentityType; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors CreateOrUpdate. */ +public final class MonitorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .define("myMonitor") + .withRegion("West US 2") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("Environment", "Dev")) + .withIdentity(new IdentityProperties().withType(ManagedIdentityType.SYSTEM_ASSIGNED)) + .withMonitoringStatus(MonitoringStatus.ENABLED) + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.ACTIVE) + .withDynatraceEnvironmentProperties( + new DynatraceEnvironmentProperties() + .withAccountInfo(new AccountInfo()) + .withEnvironmentInfo(new EnvironmentInfo()) + .withSingleSignOnProperties(new DynatraceSingleSignOnProperties())) + .withUserInfo( + new UserInfo() + .withFirstName("Alice") + .withLastName("Bobab") + .withEmailAddress("alice@microsoft.com") + .withPhoneNumber("123456") + .withCountry("westus2")) + .withPlanData( + new PlanData() + .withUsageType("Committed") + .withBillingCycle("Monthly") + .withPlanDetails("dynatraceapitestplan") + .withEffectiveDate(OffsetDateTime.parse("2019-08-30T15:14:33+02:00"))) + .create(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .define("myMonitor") + .withRegion("West US 2") + .withExistingResourceGroup("myResourceGroup") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Monitors_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors Delete. */ +public final class MonitorsDeleteSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_Delete_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsDeleteMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().delete("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_Delete_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsDeleteMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().delete("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_GetAccountCredentials + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors GetAccountCredentials. */ +public final class MonitorsGetAccountCredentialsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetAccountCredentials_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_GetAccountCredentials_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetAccountCredentialsMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getAccountCredentialsWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetAccountCredentials_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_GetAccountCredentials_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetAccountCredentialsMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getAccountCredentialsWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors GetByResourceGroup. */ +public final class MonitorsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Get_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_Get_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_Get_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_GetSsoDetails + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsRequest; + +/** Samples for Monitors GetSsoDetails. */ +public final class MonitorsGetSsoDetailsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetSSODetails_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_GetSSODetails_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetSSODetailsMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .getSsoDetailsWithResponse( + "myResourceGroup", + "myMonitor", + new SsoDetailsRequest().withUserPrincipal("alice@microsoft.com"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetSSODetails_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_GetSSODetails_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetSSODetailsMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .getSsoDetailsWithResponse("myResourceGroup", "myMonitor", new SsoDetailsRequest(), Context.NONE); + } +} +``` + +### Monitors_GetVMHostPayload + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors GetVMHostPayload. */ +public final class MonitorsGetVMHostPayloadSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetVMHostPayload_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_GetVMHostPayload_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetVMHostPayloadMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getVMHostPayloadWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetVMHostPayload_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_GetVMHostPayload_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetVMHostPayloadMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getVMHostPayloadWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_List + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors List. */ +public final class MonitorsListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListBySubscriptionId_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListBySubscriptionId_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListBySubscriptionIdMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListBySubscriptionId_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListBySubscriptionId_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListBySubscriptionIdMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().list(Context.NONE); + } +} +``` + +### Monitors_ListAppServices + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors ListAppServices. */ +public final class MonitorsListAppServicesSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListAppServices_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListAppServices_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListAppServicesMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listAppServices("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListAppServices_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListAppServices_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListAppServicesMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listAppServices("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors ListByResourceGroup. */ +public final class MonitorsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listByResourceGroup("myResourceGroup", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### Monitors_ListHosts + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors ListHosts. */ +public final class MonitorsListHostsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListHosts_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListHosts_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListHostsMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listHosts("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListHosts_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListHosts_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListHostsMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listHosts("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_ListLinkableEnvironments + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentRequest; + +/** Samples for Monitors ListLinkableEnvironments. */ +public final class MonitorsListLinkableEnvironmentsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListLinkableEnvironments_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListLinkableEnvironments_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListLinkableEnvironmentsMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .listLinkableEnvironments("myResourceGroup", "myMonitor", new LinkableEnvironmentRequest(), Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListLinkableEnvironments_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListLinkableEnvironments_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListLinkableEnvironmentsMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .listLinkableEnvironments( + "myResourceGroup", + "myMonitor", + new LinkableEnvironmentRequest() + .withTenantId("00000000-0000-0000-0000-000000000000") + .withUserPrincipal("alice@microsoft.com") + .withRegion("East US"), + Context.NONE); + } +} +``` + +### Monitors_ListMonitoredResources + +```java +import com.azure.core.util.Context; + +/** Samples for Monitors ListMonitoredResources. */ +public final class MonitorsListMonitoredResourcesSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListMonitoredResources_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListMonitoredResourcesMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listMonitoredResources("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListMonitoredResources_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListMonitoredResourcesMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listMonitoredResources("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### Monitors_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnProperties; +import com.azure.resourcemanager.dynatrace.models.AccountInfo; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.EnvironmentInfo; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitorResource; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors Update. */ +public final class MonitorsUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Update_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_Update_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsUpdateMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + MonitorResource resource = + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE).getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_Update_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsUpdateMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + MonitorResource resource = + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("Environment", "Dev")) + .withMonitoringStatus(MonitoringStatus.ENABLED) + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.ACTIVE) + .withDynatraceEnvironmentProperties( + new DynatraceEnvironmentProperties() + .withAccountInfo(new AccountInfo()) + .withEnvironmentInfo(new EnvironmentInfo()) + .withSingleSignOnProperties(new DynatraceSingleSignOnProperties())) + .withUserInfo( + new UserInfo() + .withFirstName("Alice") + .withLastName("Bobab") + .withEmailAddress("alice@microsoft.com") + .withPhoneNumber("123456") + .withCountry("westus2")) + .withPlanData( + new PlanData() + .withUsageType("Committed") + .withBillingCycle("Monthly") + .withPlanDetails("dynatraceapitestplan") + .withEffectiveDate(OffsetDateTime.parse("2019-08-30T15:14:33+02:00"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.operations().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### SingleSignOn_CreateOrUpdate + +```java +import com.azure.resourcemanager.dynatrace.models.SingleSignOnStates; +import java.util.Arrays; + +/** Samples for SingleSignOn CreateOrUpdate. */ +public final class SingleSignOnCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .singleSignOns() + .define("default") + .withExistingMonitor("myResourceGroup", "myMonitor") + .withSingleSignOnState(SingleSignOnStates.ENABLE) + .withEnterpriseAppId("00000000-0000-0000-0000-000000000000") + .withSingleSignOnUrl("https://www.dynatrace.io") + .withAadDomains(Arrays.asList("mpliftrdt20210811outlook.onmicrosoft.com")) + .create(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .singleSignOns() + .define("default") + .withExistingMonitor("myResourceGroup", "myMonitor") + .withSingleSignOnUrl("https://www.dynatrace.io") + .withAadDomains(Arrays.asList("mpliftrdt20210811outlook.onmicrosoft.com")) + .create(); + } +} +``` + +### SingleSignOn_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SingleSignOn Get. */ +public final class SingleSignOnGetSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_Get_MinimumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_Get_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnGetMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_Get_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnGetMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } +} +``` + +### SingleSignOn_List + +```java +import com.azure.core.util.Context; + +/** Samples for SingleSignOn List. */ +public final class SingleSignOnListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_List_MaximumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_List_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnListMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().list("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_List_MinimumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_List_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnListMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().list("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### TagRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.dynatrace.models.FilteringTag; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.SendAadLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendActivityLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.dynatrace.models.TagAction; +import java.util.Arrays; + +/** Samples for TagRules CreateOrUpdate. */ +public final class TagRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .tagRules() + .define("default") + .withExistingMonitor("myResourceGroup", "myMonitor") + .withLogRules( + new LogRules() + .withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE), + new FilteringTag() + .withName("Environment") + .withValue("Dev") + .withAction(TagAction.EXCLUDE)))) + .withMetricRules( + new MetricRules() + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE)))) + .create(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().define("default").withExistingMonitor("myResourceGroup", "myMonitor").create(); + } +} +``` + +### TagRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for TagRules Delete. */ +public final class TagRulesDeleteSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_Delete_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesDeleteMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().delete("myResourceGroup", "myMonitor", "default", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_Delete_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesDeleteMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().delete("myResourceGroup", "myMonitor", "default", Context.NONE); + } +} +``` + +### TagRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for TagRules Get. */ +public final class TagRulesGetSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Get_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_Get_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesGetMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Get_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_Get_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesGetMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } +} +``` + +### TagRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for TagRules List. */ +public final class TagRulesListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_List_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_List_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesListMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().list("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_List_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_List_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesListMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().list("myResourceGroup", "myMonitor", Context.NONE); + } +} +``` + +### TagRules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.models.FilteringTag; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.SendAadLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendActivityLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.dynatrace.models.TagAction; +import com.azure.resourcemanager.dynatrace.models.TagRule; +import java.util.Arrays; + +/** Samples for TagRules Update. */ +public final class TagRulesUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Update_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_Update_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesUpdateMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + TagRule resource = + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE).getValue(); + resource + .update() + .withLogRules( + new LogRules() + .withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE), + new FilteringTag() + .withName("Environment") + .withValue("Dev") + .withAction(TagAction.EXCLUDE)))) + .withMetricRules( + new MetricRules() + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE)))) + .apply(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Update_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_Update_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesUpdateMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + TagRule resource = + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE).getValue(); + resource.update().apply(); + } +} +``` + diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml b/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml new file mode 100644 index 000000000000..e7b6d83d40b3 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-dynatrace + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Dynatrace Management + This package contains Microsoft Azure SDK for Dynatrace Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-09-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.28.0 + + + com.azure + azure-core-management + 1.6.0 + + + diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/DynatraceManager.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/DynatraceManager.java new file mode 100644 index 000000000000..4a3d5af8d86a --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/DynatraceManager.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.DynatraceObservability; +import com.azure.resourcemanager.dynatrace.implementation.DynatraceObservabilityBuilder; +import com.azure.resourcemanager.dynatrace.implementation.MonitorsImpl; +import com.azure.resourcemanager.dynatrace.implementation.OperationsImpl; +import com.azure.resourcemanager.dynatrace.implementation.SingleSignOnsImpl; +import com.azure.resourcemanager.dynatrace.implementation.TagRulesImpl; +import com.azure.resourcemanager.dynatrace.models.Monitors; +import com.azure.resourcemanager.dynatrace.models.Operations; +import com.azure.resourcemanager.dynatrace.models.SingleSignOns; +import com.azure.resourcemanager.dynatrace.models.TagRules; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to DynatraceManager. */ +public final class DynatraceManager { + private Monitors monitors; + + private Operations operations; + + private TagRules tagRules; + + private SingleSignOns singleSignOns; + + private final DynatraceObservability clientObject; + + private DynatraceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DynatraceObservabilityBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Dynatrace service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Dynatrace service API instance. + */ + public static DynatraceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Dynatrace service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Dynatrace service API instance. + */ + public static DynatraceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DynatraceManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create DynatraceManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DynatraceManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Dynatrace service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Dynatrace service API instance. + */ + public DynatraceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.dynatrace") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new DynatraceManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Monitors. + * + * @return Resource collection API of Monitors. + */ + public Monitors monitors() { + if (this.monitors == null) { + this.monitors = new MonitorsImpl(clientObject.getMonitors(), this); + } + return monitors; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of TagRules. + * + * @return Resource collection API of TagRules. + */ + public TagRules tagRules() { + if (this.tagRules == null) { + this.tagRules = new TagRulesImpl(clientObject.getTagRules(), this); + } + return tagRules; + } + + /** + * Gets the resource collection API of SingleSignOns. + * + * @return Resource collection API of SingleSignOns. + */ + public SingleSignOns singleSignOns() { + if (this.singleSignOns == null) { + this.singleSignOns = new SingleSignOnsImpl(clientObject.getSingleSignOns(), this); + } + return singleSignOns; + } + + /** + * @return Wrapped service client DynatraceObservability providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public DynatraceObservability serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/DynatraceObservability.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/DynatraceObservability.java new file mode 100644 index 000000000000..4e03dd3edbd7 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/DynatraceObservability.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for DynatraceObservability class. */ +public interface DynatraceObservability { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the MonitorsClient object to access its operations. + * + * @return the MonitorsClient object. + */ + MonitorsClient getMonitors(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the TagRulesClient object to access its operations. + * + * @return the TagRulesClient object. + */ + TagRulesClient getTagRules(); + + /** + * Gets the SingleSignOnsClient object to access its operations. + * + * @return the SingleSignOnsClient object. + */ + SingleSignOnsClient getSingleSignOns(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/MonitorsClient.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/MonitorsClient.java new file mode 100644 index 000000000000..6e387d3251c6 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/MonitorsClient.java @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dynatrace.fluent.models.AccountInfoSecureInner; +import com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner; +import com.azure.resourcemanager.dynatrace.fluent.models.SsoDetailsResponseInner; +import com.azure.resourcemanager.dynatrace.fluent.models.VMExtensionPayloadInner; +import com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentRequest; +import com.azure.resourcemanager.dynatrace.models.MonitorResourceUpdate; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsRequest; + +/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +public interface MonitorsClient { + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInfoSecureInner getAccountCredentials(String resourceGroupName, String monitorName); + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAccountCredentialsWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMonitoredResources(String resourceGroupName, String monitorName); + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMonitoredResources( + String resourceGroupName, String monitorName, Context context); + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VMExtensionPayloadInner getVMHostPayload(String resourceGroupName, String monitorName); + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVMHostPayloadWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitorResourceInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource); + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitorResourceInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context); + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, MonitorResourceInner resource); + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorResourceInner createOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context); + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorResourceInner update(String resourceGroupName, String monitorName, MonitorResourceUpdate resource); + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String monitorName, MonitorResourceUpdate resource, Context context); + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName); + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, Context context); + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName); + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, Context context); + + /** + * List all MonitorResource by subscriptionId. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all MonitorResource by subscriptionId. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listHosts(String resourceGroupName, String monitorName); + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listHosts(String resourceGroupName, String monitorName, Context context); + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAppServices(String resourceGroupName, String monitorName); + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAppServices(String resourceGroupName, String monitorName, Context context); + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsoDetailsResponseInner getSsoDetails(String resourceGroupName, String monitorName); + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the get sso details request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSsoDetailsWithResponse( + String resourceGroupName, String monitorName, SsoDetailsRequest request, Context context); + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request); + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request, Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/OperationsClient.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/OperationsClient.java new file mode 100644 index 000000000000..f6fa59626caa --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * List the operations for Dynatrace.Observability. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for Dynatrace.Observability. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/SingleSignOnsClient.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/SingleSignOnsClient.java new file mode 100644 index 000000000000..cd47fc356d53 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/SingleSignOnsClient.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner; + +/** An instance of this class provides access to all the operations defined in SingleSignOnsClient. */ +public interface SingleSignOnsClient { + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynatraceSingleSignOnResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource); + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynatraceSingleSignOnResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context); + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynatraceSingleSignOnResourceInner createOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource); + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynatraceSingleSignOnResourceInner createOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context); + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynatraceSingleSignOnResourceInner get(String resourceGroupName, String monitorName, String configurationName); + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context); + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String monitorName, Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/TagRulesClient.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/TagRulesClient.java new file mode 100644 index 000000000000..908816df9140 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/TagRulesClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner; +import com.azure.resourcemanager.dynatrace.models.TagRuleUpdate; + +/** An instance of this class provides access to all the operations defined in TagRulesClient. */ +public interface TagRulesClient { + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagRuleInner get(String resourceGroupName, String monitorName, String ruleSetName); + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String monitorName, String ruleSetName, Context context); + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagRuleInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource); + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagRuleInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context); + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagRuleInner createOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource); + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagRuleInner createOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context); + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource); + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource, Context context); + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName); + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String ruleSetName, Context context); + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, String ruleSetName); + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context); + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName, Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/AccountInfoSecureInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/AccountInfoSecureInner.java new file mode 100644 index 000000000000..a9473873c66d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/AccountInfoSecureInner.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dynatrace account API Key. */ +@Immutable +public final class AccountInfoSecureInner { + /* + * Account Id of the account this environment is linked to + */ + @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) + private String accountId; + + /* + * API Key of the user account + */ + @JsonProperty(value = "apiKey", access = JsonProperty.Access.WRITE_ONLY) + private String apiKey; + + /* + * Region in which the account is created + */ + @JsonProperty(value = "regionId", access = JsonProperty.Access.WRITE_ONLY) + private String regionId; + + /** + * Get the accountId property: Account Id of the account this environment is linked to. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Get the apiKey property: API Key of the user account. + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Get the regionId property: Region in which the account is created. + * + * @return the regionId value. + */ + public String regionId() { + return this.regionId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/AppServiceInfoInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/AppServiceInfoInner.java new file mode 100644 index 000000000000..3beba34e7a65 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/AppServiceInfoInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.AutoUpdateSetting; +import com.azure.resourcemanager.dynatrace.models.AvailabilityState; +import com.azure.resourcemanager.dynatrace.models.LogModule; +import com.azure.resourcemanager.dynatrace.models.MonitoringType; +import com.azure.resourcemanager.dynatrace.models.UpdateStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of App Services having Dynatrace OneAgent installed. */ +@Fluent +public final class AppServiceInfoInner { + /* + * App service resource ID + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Version of the Dynatrace agent installed on the App Service. + */ + @JsonProperty(value = "version") + private String version; + + /* + * The monitoring mode of OneAgent + */ + @JsonProperty(value = "monitoringType") + private MonitoringType monitoringType; + + /* + * Update settings of OneAgent. + */ + @JsonProperty(value = "autoUpdateSetting") + private AutoUpdateSetting autoUpdateSetting; + + /* + * The current update status of OneAgent. + */ + @JsonProperty(value = "updateStatus") + private UpdateStatus updateStatus; + + /* + * The availability state of OneAgent. + */ + @JsonProperty(value = "availabilityState") + private AvailabilityState availabilityState; + + /* + * Tells whether log modules are enabled or not + */ + @JsonProperty(value = "logModule") + private LogModule logModule; + + /* + * The name of the host group + */ + @JsonProperty(value = "hostGroup") + private String hostGroup; + + /* + * The name of the host + */ + @JsonProperty(value = "hostName") + private String hostname; + + /** + * Get the resourceId property: App service resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: App service resource ID. + * + * @param resourceId the resourceId value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the version property: Version of the Dynatrace agent installed on the App Service. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the Dynatrace agent installed on the App Service. + * + * @param version the version value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the monitoringType property: The monitoring mode of OneAgent. + * + * @return the monitoringType value. + */ + public MonitoringType monitoringType() { + return this.monitoringType; + } + + /** + * Set the monitoringType property: The monitoring mode of OneAgent. + * + * @param monitoringType the monitoringType value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withMonitoringType(MonitoringType monitoringType) { + this.monitoringType = monitoringType; + return this; + } + + /** + * Get the autoUpdateSetting property: Update settings of OneAgent. + * + * @return the autoUpdateSetting value. + */ + public AutoUpdateSetting autoUpdateSetting() { + return this.autoUpdateSetting; + } + + /** + * Set the autoUpdateSetting property: Update settings of OneAgent. + * + * @param autoUpdateSetting the autoUpdateSetting value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withAutoUpdateSetting(AutoUpdateSetting autoUpdateSetting) { + this.autoUpdateSetting = autoUpdateSetting; + return this; + } + + /** + * Get the updateStatus property: The current update status of OneAgent. + * + * @return the updateStatus value. + */ + public UpdateStatus updateStatus() { + return this.updateStatus; + } + + /** + * Set the updateStatus property: The current update status of OneAgent. + * + * @param updateStatus the updateStatus value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withUpdateStatus(UpdateStatus updateStatus) { + this.updateStatus = updateStatus; + return this; + } + + /** + * Get the availabilityState property: The availability state of OneAgent. + * + * @return the availabilityState value. + */ + public AvailabilityState availabilityState() { + return this.availabilityState; + } + + /** + * Set the availabilityState property: The availability state of OneAgent. + * + * @param availabilityState the availabilityState value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withAvailabilityState(AvailabilityState availabilityState) { + this.availabilityState = availabilityState; + return this; + } + + /** + * Get the logModule property: Tells whether log modules are enabled or not. + * + * @return the logModule value. + */ + public LogModule logModule() { + return this.logModule; + } + + /** + * Set the logModule property: Tells whether log modules are enabled or not. + * + * @param logModule the logModule value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withLogModule(LogModule logModule) { + this.logModule = logModule; + return this; + } + + /** + * Get the hostGroup property: The name of the host group. + * + * @return the hostGroup value. + */ + public String hostGroup() { + return this.hostGroup; + } + + /** + * Set the hostGroup property: The name of the host group. + * + * @param hostGroup the hostGroup value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withHostGroup(String hostGroup) { + this.hostGroup = hostGroup; + return this; + } + + /** + * Get the hostname property: The name of the host. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The name of the host. + * + * @param hostname the hostname value to set. + * @return the AppServiceInfoInner object itself. + */ + public AppServiceInfoInner withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/DynatraceSingleSignOnProperties.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/DynatraceSingleSignOnProperties.java new file mode 100644 index 000000000000..0a664acb3021 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/DynatraceSingleSignOnProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.SingleSignOnStates; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The details of a Dynatrace single sign-on. */ +@Fluent +public final class DynatraceSingleSignOnProperties { + /* + * State of Single Sign On + */ + @JsonProperty(value = "singleSignOnState") + private SingleSignOnStates singleSignOnState; + + /* + * Version of the Dynatrace agent installed on the VM. + */ + @JsonProperty(value = "enterpriseAppId") + private String enterpriseAppId; + + /* + * The login URL specific to this Dynatrace Environment + */ + @JsonProperty(value = "singleSignOnUrl") + private String singleSignOnUrl; + + /* + * array of Aad(azure active directory) domains + */ + @JsonProperty(value = "aadDomains") + private List aadDomains; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the singleSignOnState property: State of Single Sign On. + * + * @return the singleSignOnState value. + */ + public SingleSignOnStates singleSignOnState() { + return this.singleSignOnState; + } + + /** + * Set the singleSignOnState property: State of Single Sign On. + * + * @param singleSignOnState the singleSignOnState value to set. + * @return the DynatraceSingleSignOnProperties object itself. + */ + public DynatraceSingleSignOnProperties withSingleSignOnState(SingleSignOnStates singleSignOnState) { + this.singleSignOnState = singleSignOnState; + return this; + } + + /** + * Get the enterpriseAppId property: Version of the Dynatrace agent installed on the VM. + * + * @return the enterpriseAppId value. + */ + public String enterpriseAppId() { + return this.enterpriseAppId; + } + + /** + * Set the enterpriseAppId property: Version of the Dynatrace agent installed on the VM. + * + * @param enterpriseAppId the enterpriseAppId value to set. + * @return the DynatraceSingleSignOnProperties object itself. + */ + public DynatraceSingleSignOnProperties withEnterpriseAppId(String enterpriseAppId) { + this.enterpriseAppId = enterpriseAppId; + return this; + } + + /** + * Get the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @return the singleSignOnUrl value. + */ + public String singleSignOnUrl() { + return this.singleSignOnUrl; + } + + /** + * Set the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @param singleSignOnUrl the singleSignOnUrl value to set. + * @return the DynatraceSingleSignOnProperties object itself. + */ + public DynatraceSingleSignOnProperties withSingleSignOnUrl(String singleSignOnUrl) { + this.singleSignOnUrl = singleSignOnUrl; + return this; + } + + /** + * Get the aadDomains property: array of Aad(azure active directory) domains. + * + * @return the aadDomains value. + */ + public List aadDomains() { + return this.aadDomains; + } + + /** + * Set the aadDomains property: array of Aad(azure active directory) domains. + * + * @param aadDomains the aadDomains value to set. + * @return the DynatraceSingleSignOnProperties object itself. + */ + public DynatraceSingleSignOnProperties withAadDomains(List aadDomains) { + this.aadDomains = aadDomains; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/DynatraceSingleSignOnResourceInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/DynatraceSingleSignOnResourceInner.java new file mode 100644 index 000000000000..3545720f75da --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/DynatraceSingleSignOnResourceInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.SingleSignOnStates; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Single sign-on configurations for a given monitor resource. */ +@Fluent +public final class DynatraceSingleSignOnResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties", required = true) + private DynatraceSingleSignOnProperties innerProperties = new DynatraceSingleSignOnProperties(); + + /* + * System metadata for this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private DynatraceSingleSignOnProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: System metadata for this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the singleSignOnState property: State of Single Sign On. + * + * @return the singleSignOnState value. + */ + public SingleSignOnStates singleSignOnState() { + return this.innerProperties() == null ? null : this.innerProperties().singleSignOnState(); + } + + /** + * Set the singleSignOnState property: State of Single Sign On. + * + * @param singleSignOnState the singleSignOnState value to set. + * @return the DynatraceSingleSignOnResourceInner object itself. + */ + public DynatraceSingleSignOnResourceInner withSingleSignOnState(SingleSignOnStates singleSignOnState) { + if (this.innerProperties() == null) { + this.innerProperties = new DynatraceSingleSignOnProperties(); + } + this.innerProperties().withSingleSignOnState(singleSignOnState); + return this; + } + + /** + * Get the enterpriseAppId property: Version of the Dynatrace agent installed on the VM. + * + * @return the enterpriseAppId value. + */ + public String enterpriseAppId() { + return this.innerProperties() == null ? null : this.innerProperties().enterpriseAppId(); + } + + /** + * Set the enterpriseAppId property: Version of the Dynatrace agent installed on the VM. + * + * @param enterpriseAppId the enterpriseAppId value to set. + * @return the DynatraceSingleSignOnResourceInner object itself. + */ + public DynatraceSingleSignOnResourceInner withEnterpriseAppId(String enterpriseAppId) { + if (this.innerProperties() == null) { + this.innerProperties = new DynatraceSingleSignOnProperties(); + } + this.innerProperties().withEnterpriseAppId(enterpriseAppId); + return this; + } + + /** + * Get the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @return the singleSignOnUrl value. + */ + public String singleSignOnUrl() { + return this.innerProperties() == null ? null : this.innerProperties().singleSignOnUrl(); + } + + /** + * Set the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @param singleSignOnUrl the singleSignOnUrl value to set. + * @return the DynatraceSingleSignOnResourceInner object itself. + */ + public DynatraceSingleSignOnResourceInner withSingleSignOnUrl(String singleSignOnUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new DynatraceSingleSignOnProperties(); + } + this.innerProperties().withSingleSignOnUrl(singleSignOnUrl); + return this; + } + + /** + * Get the aadDomains property: array of Aad(azure active directory) domains. + * + * @return the aadDomains value. + */ + public List aadDomains() { + return this.innerProperties() == null ? null : this.innerProperties().aadDomains(); + } + + /** + * Set the aadDomains property: array of Aad(azure active directory) domains. + * + * @param aadDomains the aadDomains value to set. + * @return the DynatraceSingleSignOnResourceInner object itself. + */ + public DynatraceSingleSignOnResourceInner withAadDomains(List aadDomains) { + if (this.innerProperties() == null) { + this.innerProperties = new DynatraceSingleSignOnProperties(); + } + this.innerProperties().withAadDomains(aadDomains); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model DynatraceSingleSignOnResourceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DynatraceSingleSignOnResourceInner.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/LinkableEnvironmentResponseInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/LinkableEnvironmentResponseInner.java new file mode 100644 index 000000000000..26c2d9fb2f54 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/LinkableEnvironmentResponseInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for getting all the linkable environments. */ +@Fluent +public final class LinkableEnvironmentResponseInner { + /* + * environment id for which user is an admin + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * Name of the environment + */ + @JsonProperty(value = "environmentName") + private String environmentName; + + /* + * Billing plan information. + */ + @JsonProperty(value = "planData") + private PlanData planData; + + /** + * Get the environmentId property: environment id for which user is an admin. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: environment id for which user is an admin. + * + * @param environmentId the environmentId value to set. + * @return the LinkableEnvironmentResponseInner object itself. + */ + public LinkableEnvironmentResponseInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the environmentName property: Name of the environment. + * + * @return the environmentName value. + */ + public String environmentName() { + return this.environmentName; + } + + /** + * Set the environmentName property: Name of the environment. + * + * @param environmentName the environmentName value to set. + * @return the LinkableEnvironmentResponseInner object itself. + */ + public LinkableEnvironmentResponseInner withEnvironmentName(String environmentName) { + this.environmentName = environmentName; + return this; + } + + /** + * Get the planData property: Billing plan information. + * + * @return the planData value. + */ + public PlanData planData() { + return this.planData; + } + + /** + * Set the planData property: Billing plan information. + * + * @param planData the planData value to set. + * @return the LinkableEnvironmentResponseInner object itself. + */ + public LinkableEnvironmentResponseInner withPlanData(PlanData planData) { + this.planData = planData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (planData() != null) { + planData().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitorProperties.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitorProperties.java new file mode 100644 index 000000000000..8dde276b57fc --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitorProperties.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.LiftrResourceCategories; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties specific to the monitor resource. */ +@Fluent +public final class MonitorProperties { + /* + * Status of the monitor. + */ + @JsonProperty(value = "monitoringStatus") + private MonitoringStatus monitoringStatus; + + /* + * Marketplace subscription status. + */ + @JsonProperty(value = "marketplaceSubscriptionStatus") + private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; + + /* + * Properties of the Dynatrace environment. + */ + @JsonProperty(value = "dynatraceEnvironmentProperties") + private DynatraceEnvironmentProperties dynatraceEnvironmentProperties; + + /* + * User info. + */ + @JsonProperty(value = "userInfo") + private UserInfo userInfo; + + /* + * Billing plan information. + */ + @JsonProperty(value = "planData") + private PlanData planData; + + /* + * Liftr Resource category. + */ + @JsonProperty(value = "liftrResourceCategory", access = JsonProperty.Access.WRITE_ONLY) + private LiftrResourceCategories liftrResourceCategory; + + /* + * The priority of the resource. + */ + @JsonProperty(value = "liftrResourcePreference", access = JsonProperty.Access.WRITE_ONLY) + private Integer liftrResourcePreference; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the monitoringStatus property: Status of the monitor. + * + * @return the monitoringStatus value. + */ + public MonitoringStatus monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoringStatus property: Status of the monitor. + * + * @param monitoringStatus the monitoringStatus value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + + /** + * Get the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @return the marketplaceSubscriptionStatus value. + */ + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.marketplaceSubscriptionStatus; + } + + /** + * Set the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @param marketplaceSubscriptionStatus the marketplaceSubscriptionStatus value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withMarketplaceSubscriptionStatus( + MarketplaceSubscriptionStatus marketplaceSubscriptionStatus) { + this.marketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + return this; + } + + /** + * Get the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @return the dynatraceEnvironmentProperties value. + */ + public DynatraceEnvironmentProperties dynatraceEnvironmentProperties() { + return this.dynatraceEnvironmentProperties; + } + + /** + * Set the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @param dynatraceEnvironmentProperties the dynatraceEnvironmentProperties value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withDynatraceEnvironmentProperties( + DynatraceEnvironmentProperties dynatraceEnvironmentProperties) { + this.dynatraceEnvironmentProperties = dynatraceEnvironmentProperties; + return this; + } + + /** + * Get the userInfo property: User info. + * + * @return the userInfo value. + */ + public UserInfo userInfo() { + return this.userInfo; + } + + /** + * Set the userInfo property: User info. + * + * @param userInfo the userInfo value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withUserInfo(UserInfo userInfo) { + this.userInfo = userInfo; + return this; + } + + /** + * Get the planData property: Billing plan information. + * + * @return the planData value. + */ + public PlanData planData() { + return this.planData; + } + + /** + * Set the planData property: Billing plan information. + * + * @param planData the planData value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withPlanData(PlanData planData) { + this.planData = planData; + return this; + } + + /** + * Get the liftrResourceCategory property: Liftr Resource category. + * + * @return the liftrResourceCategory value. + */ + public LiftrResourceCategories liftrResourceCategory() { + return this.liftrResourceCategory; + } + + /** + * Get the liftrResourcePreference property: The priority of the resource. + * + * @return the liftrResourcePreference value. + */ + public Integer liftrResourcePreference() { + return this.liftrResourcePreference; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dynatraceEnvironmentProperties() != null) { + dynatraceEnvironmentProperties().validate(); + } + if (userInfo() != null) { + userInfo().validate(); + } + if (planData() != null) { + planData().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitorResourceInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitorResourceInner.java new file mode 100644 index 000000000000..1c336220acf9 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitorResourceInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.IdentityProperties; +import com.azure.resourcemanager.dynatrace.models.LiftrResourceCategories; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Dynatrace Monitor Resource. */ +@Fluent +public final class MonitorResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties", required = true) + private MonitorProperties innerProperties = new MonitorProperties(); + + /* + * System metadata for this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The managed service identities assigned to this resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private MonitorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: System metadata for this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the MonitorResourceInner object itself. + */ + public MonitorResourceInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public MonitorResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MonitorResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the monitoringStatus property: Status of the monitor. + * + * @return the monitoringStatus value. + */ + public MonitoringStatus monitoringStatus() { + return this.innerProperties() == null ? null : this.innerProperties().monitoringStatus(); + } + + /** + * Set the monitoringStatus property: Status of the monitor. + * + * @param monitoringStatus the monitoringStatus value to set. + * @return the MonitorResourceInner object itself. + */ + public MonitorResourceInner withMonitoringStatus(MonitoringStatus monitoringStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withMonitoringStatus(monitoringStatus); + return this; + } + + /** + * Get the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @return the marketplaceSubscriptionStatus value. + */ + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().marketplaceSubscriptionStatus(); + } + + /** + * Set the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @param marketplaceSubscriptionStatus the marketplaceSubscriptionStatus value to set. + * @return the MonitorResourceInner object itself. + */ + public MonitorResourceInner withMarketplaceSubscriptionStatus( + MarketplaceSubscriptionStatus marketplaceSubscriptionStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withMarketplaceSubscriptionStatus(marketplaceSubscriptionStatus); + return this; + } + + /** + * Get the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @return the dynatraceEnvironmentProperties value. + */ + public DynatraceEnvironmentProperties dynatraceEnvironmentProperties() { + return this.innerProperties() == null ? null : this.innerProperties().dynatraceEnvironmentProperties(); + } + + /** + * Set the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @param dynatraceEnvironmentProperties the dynatraceEnvironmentProperties value to set. + * @return the MonitorResourceInner object itself. + */ + public MonitorResourceInner withDynatraceEnvironmentProperties( + DynatraceEnvironmentProperties dynatraceEnvironmentProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withDynatraceEnvironmentProperties(dynatraceEnvironmentProperties); + return this; + } + + /** + * Get the userInfo property: User info. + * + * @return the userInfo value. + */ + public UserInfo userInfo() { + return this.innerProperties() == null ? null : this.innerProperties().userInfo(); + } + + /** + * Set the userInfo property: User info. + * + * @param userInfo the userInfo value to set. + * @return the MonitorResourceInner object itself. + */ + public MonitorResourceInner withUserInfo(UserInfo userInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withUserInfo(userInfo); + return this; + } + + /** + * Get the planData property: Billing plan information. + * + * @return the planData value. + */ + public PlanData planData() { + return this.innerProperties() == null ? null : this.innerProperties().planData(); + } + + /** + * Set the planData property: Billing plan information. + * + * @param planData the planData value to set. + * @return the MonitorResourceInner object itself. + */ + public MonitorResourceInner withPlanData(PlanData planData) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withPlanData(planData); + return this; + } + + /** + * Get the liftrResourceCategory property: Liftr Resource category. + * + * @return the liftrResourceCategory value. + */ + public LiftrResourceCategories liftrResourceCategory() { + return this.innerProperties() == null ? null : this.innerProperties().liftrResourceCategory(); + } + + /** + * Get the liftrResourcePreference property: The priority of the resource. + * + * @return the liftrResourcePreference value. + */ + public Integer liftrResourcePreference() { + return this.innerProperties() == null ? null : this.innerProperties().liftrResourcePreference(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model MonitorResourceInner")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorResourceInner.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitoredResourceInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitoredResourceInner.java new file mode 100644 index 000000000000..bd4f774d749c --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitoredResourceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.SendingLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendingMetricsStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of resource being monitored by Dynatrace monitor resource. */ +@Fluent +public final class MonitoredResourceInner { + /* + * The ARM id of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Flag indicating if resource is sending metrics to Dynatrace. + */ + @JsonProperty(value = "sendingMetrics") + private SendingMetricsStatus 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 Dynatrace. + */ + @JsonProperty(value = "sendingLogs") + private SendingLogsStatus sendingLogs; + + /* + * Reason for why the resource is sending logs (or why it is not sending). + */ + @JsonProperty(value = "reasonForLogsStatus") + private String reasonForLogsStatus; + + /** + * Get the id property: The ARM id of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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 the sendingMetrics property: Flag indicating if resource is sending metrics to Dynatrace. + * + * @return the sendingMetrics value. + */ + public SendingMetricsStatus sendingMetrics() { + return this.sendingMetrics; + } + + /** + * Set the sendingMetrics property: Flag indicating if resource is sending metrics to Dynatrace. + * + * @param sendingMetrics the sendingMetrics value to set. + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withSendingMetrics(SendingMetricsStatus sendingMetrics) { + this.sendingMetrics = sendingMetrics; + return this; + } + + /** + * Get the reasonForMetricsStatus property: 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 the reasonForMetricsStatus property: 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 the sendingLogs property: Flag indicating if resource is sending logs to Dynatrace. + * + * @return the sendingLogs value. + */ + public SendingLogsStatus sendingLogs() { + return this.sendingLogs; + } + + /** + * Set the sendingLogs property: Flag indicating if resource is sending logs to Dynatrace. + * + * @param sendingLogs the sendingLogs value to set. + * @return the MonitoredResourceInner object itself. + */ + public MonitoredResourceInner withSendingLogs(SendingLogsStatus sendingLogs) { + this.sendingLogs = sendingLogs; + return this; + } + + /** + * Get the reasonForLogsStatus property: 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 the reasonForLogsStatus property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitoringTagRulesProperties.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitoringTagRulesProperties.java new file mode 100644 index 000000000000..d89f7e5ba214 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/MonitoringTagRulesProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for the Tag rules resource of a Monitor account. */ +@Fluent +public final class MonitoringTagRulesProperties { + /* + * Set of rules for sending logs for the Monitor resource. + */ + @JsonProperty(value = "logRules") + private LogRules logRules; + + /* + * Set of rules for sending metrics for the Monitor resource. + */ + @JsonProperty(value = "metricRules") + private MetricRules metricRules; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @return the logRules value. + */ + public LogRules logRules() { + return this.logRules; + } + + /** + * Set the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @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 property: Set of rules for sending metrics for the Monitor resource. + * + * @return the metricRules value. + */ + public MetricRules metricRules() { + return this.metricRules; + } + + /** + * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. + * + * @param metricRules the metricRules value to set. + * @return the MonitoringTagRulesProperties object itself. + */ + public MonitoringTagRulesProperties withMetricRules(MetricRules metricRules) { + this.metricRules = metricRules; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logRules() != null) { + logRules().validate(); + } + if (metricRules() != null) { + metricRules().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/OperationInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/OperationInner.java new file mode 100644 index 000000000000..92ea3bd4b681 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/OperationInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.ActionType; +import com.azure.resourcemanager.dynatrace.models.OperationDisplay; +import com.azure.resourcemanager.dynatrace.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/SsoDetailsResponseInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/SsoDetailsResponseInner.java new file mode 100644 index 000000000000..0ee062dfc6db --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/SsoDetailsResponseInner.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.SsoStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSO details from the Dynatrace partner. */ +@Fluent +public final class SsoDetailsResponseInner { + /* + * Whether the SSO is enabled for this resource or not. + */ + @JsonProperty(value = "isSsoEnabled") + private SsoStatus isSsoEnabled; + + /* + * URL for Azure AD metadata + */ + @JsonProperty(value = "metadataUrl") + private String metadataUrl; + + /* + * The login URL specific to this Dynatrace Environment + */ + @JsonProperty(value = "singleSignOnUrl") + private String singleSignOnUrl; + + /* + * array of Aad(azure active directory) domains + */ + @JsonProperty(value = "aadDomains") + private List aadDomains; + + /* + * Array of admin user emails. + */ + @JsonProperty(value = "adminUsers") + private List adminUsers; + + /** + * Get the isSsoEnabled property: Whether the SSO is enabled for this resource or not. + * + * @return the isSsoEnabled value. + */ + public SsoStatus isSsoEnabled() { + return this.isSsoEnabled; + } + + /** + * Set the isSsoEnabled property: Whether the SSO is enabled for this resource or not. + * + * @param isSsoEnabled the isSsoEnabled value to set. + * @return the SsoDetailsResponseInner object itself. + */ + public SsoDetailsResponseInner withIsSsoEnabled(SsoStatus isSsoEnabled) { + this.isSsoEnabled = isSsoEnabled; + return this; + } + + /** + * Get the metadataUrl property: URL for Azure AD metadata. + * + * @return the metadataUrl value. + */ + public String metadataUrl() { + return this.metadataUrl; + } + + /** + * Set the metadataUrl property: URL for Azure AD metadata. + * + * @param metadataUrl the metadataUrl value to set. + * @return the SsoDetailsResponseInner object itself. + */ + public SsoDetailsResponseInner withMetadataUrl(String metadataUrl) { + this.metadataUrl = metadataUrl; + return this; + } + + /** + * Get the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @return the singleSignOnUrl value. + */ + public String singleSignOnUrl() { + return this.singleSignOnUrl; + } + + /** + * Set the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @param singleSignOnUrl the singleSignOnUrl value to set. + * @return the SsoDetailsResponseInner object itself. + */ + public SsoDetailsResponseInner withSingleSignOnUrl(String singleSignOnUrl) { + this.singleSignOnUrl = singleSignOnUrl; + return this; + } + + /** + * Get the aadDomains property: array of Aad(azure active directory) domains. + * + * @return the aadDomains value. + */ + public List aadDomains() { + return this.aadDomains; + } + + /** + * Set the aadDomains property: array of Aad(azure active directory) domains. + * + * @param aadDomains the aadDomains value to set. + * @return the SsoDetailsResponseInner object itself. + */ + public SsoDetailsResponseInner withAadDomains(List aadDomains) { + this.aadDomains = aadDomains; + return this; + } + + /** + * Get the adminUsers property: Array of admin user emails. + * + * @return the adminUsers value. + */ + public List adminUsers() { + return this.adminUsers; + } + + /** + * Set the adminUsers property: Array of admin user emails. + * + * @param adminUsers the adminUsers value to set. + * @return the SsoDetailsResponseInner object itself. + */ + public SsoDetailsResponseInner withAdminUsers(List adminUsers) { + this.adminUsers = adminUsers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/TagRuleInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/TagRuleInner.java new file mode 100644 index 000000000000..377d7778041f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/TagRuleInner.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tag rules for a monitor resource. */ +@Fluent +public final class TagRuleInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties", required = true) + private MonitoringTagRulesProperties innerProperties = new MonitoringTagRulesProperties(); + + /* + * System metadata for this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private MonitoringTagRulesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: System metadata for this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @return the logRules value. + */ + public LogRules logRules() { + return this.innerProperties() == null ? null : this.innerProperties().logRules(); + } + + /** + * Set the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @param logRules the logRules value to set. + * @return the TagRuleInner object itself. + */ + public TagRuleInner withLogRules(LogRules logRules) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitoringTagRulesProperties(); + } + this.innerProperties().withLogRules(logRules); + return this; + } + + /** + * Get the metricRules property: Set of rules for sending metrics for the Monitor resource. + * + * @return the metricRules value. + */ + public MetricRules metricRules() { + return this.innerProperties() == null ? null : this.innerProperties().metricRules(); + } + + /** + * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. + * + * @param metricRules the metricRules value to set. + * @return the TagRuleInner object itself. + */ + public TagRuleInner withMetricRules(MetricRules metricRules) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitoringTagRulesProperties(); + } + this.innerProperties().withMetricRules(metricRules); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model TagRuleInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TagRuleInner.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/VMExtensionPayloadInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/VMExtensionPayloadInner.java new file mode 100644 index 000000000000..2b9bee45a3b1 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/VMExtensionPayloadInner.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response of payload to be passed while installing VM agent. */ +@Fluent +public final class VMExtensionPayloadInner { + /* + * Ingestion key of the environment + */ + @JsonProperty(value = "ingestionKey") + private String ingestionKey; + + /* + * Id of the environment created + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /** + * Get the ingestionKey property: Ingestion key of the environment. + * + * @return the ingestionKey value. + */ + public String ingestionKey() { + return this.ingestionKey; + } + + /** + * Set the ingestionKey property: Ingestion key of the environment. + * + * @param ingestionKey the ingestionKey value to set. + * @return the VMExtensionPayloadInner object itself. + */ + public VMExtensionPayloadInner withIngestionKey(String ingestionKey) { + this.ingestionKey = ingestionKey; + return this; + } + + /** + * Get the environmentId property: Id of the environment created. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Id of the environment created. + * + * @param environmentId the environmentId value to set. + * @return the VMExtensionPayloadInner object itself. + */ + public VMExtensionPayloadInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/VMInfoInner.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/VMInfoInner.java new file mode 100644 index 000000000000..53f5a6beafbd --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/VMInfoInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.models.AutoUpdateSetting; +import com.azure.resourcemanager.dynatrace.models.AvailabilityState; +import com.azure.resourcemanager.dynatrace.models.LogModule; +import com.azure.resourcemanager.dynatrace.models.MonitoringType; +import com.azure.resourcemanager.dynatrace.models.UpdateStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of VM Resource having Dynatrace OneAgent installed. */ +@Fluent +public final class VMInfoInner { + /* + * Azure VM resource ID + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Version of the Dynatrace agent installed on the VM. + */ + @JsonProperty(value = "version") + private String version; + + /* + * The monitoring mode of OneAgent + */ + @JsonProperty(value = "monitoringType") + private MonitoringType monitoringType; + + /* + * Update settings of OneAgent. + */ + @JsonProperty(value = "autoUpdateSetting") + private AutoUpdateSetting autoUpdateSetting; + + /* + * The current update status of OneAgent. + */ + @JsonProperty(value = "updateStatus") + private UpdateStatus updateStatus; + + /* + * The availability state of OneAgent. + */ + @JsonProperty(value = "availabilityState") + private AvailabilityState availabilityState; + + /* + * Tells whether log modules are enabled or not + */ + @JsonProperty(value = "logModule") + private LogModule logModule; + + /* + * The name of the host group + */ + @JsonProperty(value = "hostGroup") + private String hostGroup; + + /* + * The name of the host + */ + @JsonProperty(value = "hostName") + private String hostname; + + /** + * Get the resourceId property: Azure VM resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Azure VM resource ID. + * + * @param resourceId the resourceId value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the version property: Version of the Dynatrace agent installed on the VM. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the Dynatrace agent installed on the VM. + * + * @param version the version value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the monitoringType property: The monitoring mode of OneAgent. + * + * @return the monitoringType value. + */ + public MonitoringType monitoringType() { + return this.monitoringType; + } + + /** + * Set the monitoringType property: The monitoring mode of OneAgent. + * + * @param monitoringType the monitoringType value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withMonitoringType(MonitoringType monitoringType) { + this.monitoringType = monitoringType; + return this; + } + + /** + * Get the autoUpdateSetting property: Update settings of OneAgent. + * + * @return the autoUpdateSetting value. + */ + public AutoUpdateSetting autoUpdateSetting() { + return this.autoUpdateSetting; + } + + /** + * Set the autoUpdateSetting property: Update settings of OneAgent. + * + * @param autoUpdateSetting the autoUpdateSetting value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withAutoUpdateSetting(AutoUpdateSetting autoUpdateSetting) { + this.autoUpdateSetting = autoUpdateSetting; + return this; + } + + /** + * Get the updateStatus property: The current update status of OneAgent. + * + * @return the updateStatus value. + */ + public UpdateStatus updateStatus() { + return this.updateStatus; + } + + /** + * Set the updateStatus property: The current update status of OneAgent. + * + * @param updateStatus the updateStatus value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withUpdateStatus(UpdateStatus updateStatus) { + this.updateStatus = updateStatus; + return this; + } + + /** + * Get the availabilityState property: The availability state of OneAgent. + * + * @return the availabilityState value. + */ + public AvailabilityState availabilityState() { + return this.availabilityState; + } + + /** + * Set the availabilityState property: The availability state of OneAgent. + * + * @param availabilityState the availabilityState value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withAvailabilityState(AvailabilityState availabilityState) { + this.availabilityState = availabilityState; + return this; + } + + /** + * Get the logModule property: Tells whether log modules are enabled or not. + * + * @return the logModule value. + */ + public LogModule logModule() { + return this.logModule; + } + + /** + * Set the logModule property: Tells whether log modules are enabled or not. + * + * @param logModule the logModule value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withLogModule(LogModule logModule) { + this.logModule = logModule; + return this; + } + + /** + * Get the hostGroup property: The name of the host group. + * + * @return the hostGroup value. + */ + public String hostGroup() { + return this.hostGroup; + } + + /** + * Set the hostGroup property: The name of the host group. + * + * @param hostGroup the hostGroup value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withHostGroup(String hostGroup) { + this.hostGroup = hostGroup; + return this; + } + + /** + * Get the hostname property: The name of the host. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The name of the host. + * + * @param hostname the hostname value to set. + * @return the VMInfoInner object itself. + */ + public VMInfoInner withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/package-info.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/package-info.java new file mode 100644 index 000000000000..9d36a27e190f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for DynatraceObservability. null. */ +package com.azure.resourcemanager.dynatrace.fluent.models; diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/package-info.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/package-info.java new file mode 100644 index 000000000000..205eb4e7b533 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for DynatraceObservability. null. */ +package com.azure.resourcemanager.dynatrace.fluent; diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/AccountInfoSecureImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/AccountInfoSecureImpl.java new file mode 100644 index 000000000000..e60046ccd29a --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/AccountInfoSecureImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.AccountInfoSecureInner; +import com.azure.resourcemanager.dynatrace.models.AccountInfoSecure; + +public final class AccountInfoSecureImpl implements AccountInfoSecure { + private AccountInfoSecureInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + AccountInfoSecureImpl( + AccountInfoSecureInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String accountId() { + return this.innerModel().accountId(); + } + + public String apiKey() { + return this.innerModel().apiKey(); + } + + public String regionId() { + return this.innerModel().regionId(); + } + + public AccountInfoSecureInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/AppServiceInfoImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/AppServiceInfoImpl.java new file mode 100644 index 000000000000..a4d63dd08b32 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/AppServiceInfoImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.dynatrace.models.AppServiceInfo; +import com.azure.resourcemanager.dynatrace.models.AutoUpdateSetting; +import com.azure.resourcemanager.dynatrace.models.AvailabilityState; +import com.azure.resourcemanager.dynatrace.models.LogModule; +import com.azure.resourcemanager.dynatrace.models.MonitoringType; +import com.azure.resourcemanager.dynatrace.models.UpdateStatus; + +public final class AppServiceInfoImpl implements AppServiceInfo { + private AppServiceInfoInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + AppServiceInfoImpl( + AppServiceInfoInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String version() { + return this.innerModel().version(); + } + + public MonitoringType monitoringType() { + return this.innerModel().monitoringType(); + } + + public AutoUpdateSetting autoUpdateSetting() { + return this.innerModel().autoUpdateSetting(); + } + + public UpdateStatus updateStatus() { + return this.innerModel().updateStatus(); + } + + public AvailabilityState availabilityState() { + return this.innerModel().availabilityState(); + } + + public LogModule logModule() { + return this.innerModel().logModule(); + } + + public String hostGroup() { + return this.innerModel().hostGroup(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public AppServiceInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceObservabilityBuilder.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceObservabilityBuilder.java new file mode 100644 index 000000000000..b48208a80db0 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceObservabilityBuilder.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the DynatraceObservabilityImpl type. */ +@ServiceClientBuilder(serviceClients = {DynatraceObservabilityImpl.class}) +public final class DynatraceObservabilityBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the DynatraceObservabilityBuilder. + */ + public DynatraceObservabilityBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DynatraceObservabilityBuilder. + */ + public DynatraceObservabilityBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the DynatraceObservabilityBuilder. + */ + public DynatraceObservabilityBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the DynatraceObservabilityBuilder. + */ + public DynatraceObservabilityBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the DynatraceObservabilityBuilder. + */ + public DynatraceObservabilityBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the DynatraceObservabilityBuilder. + */ + public DynatraceObservabilityBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DynatraceObservabilityImpl with the provided parameters. + * + * @return an instance of DynatraceObservabilityImpl. + */ + public DynatraceObservabilityImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + DynatraceObservabilityImpl client = + new DynatraceObservabilityImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceObservabilityImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceObservabilityImpl.java new file mode 100644 index 000000000000..77e10cceeb12 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceObservabilityImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.dynatrace.fluent.DynatraceObservability; +import com.azure.resourcemanager.dynatrace.fluent.MonitorsClient; +import com.azure.resourcemanager.dynatrace.fluent.OperationsClient; +import com.azure.resourcemanager.dynatrace.fluent.SingleSignOnsClient; +import com.azure.resourcemanager.dynatrace.fluent.TagRulesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the DynatraceObservabilityImpl type. */ +@ServiceClient(builder = DynatraceObservabilityBuilder.class) +public final class DynatraceObservabilityImpl implements DynatraceObservability { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The MonitorsClient object to access its operations. */ + private final MonitorsClient monitors; + + /** + * Gets the MonitorsClient object to access its operations. + * + * @return the MonitorsClient object. + */ + public MonitorsClient getMonitors() { + return this.monitors; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The TagRulesClient object to access its operations. */ + private final TagRulesClient tagRules; + + /** + * Gets the TagRulesClient object to access its operations. + * + * @return the TagRulesClient object. + */ + public TagRulesClient getTagRules() { + return this.tagRules; + } + + /** The SingleSignOnsClient object to access its operations. */ + private final SingleSignOnsClient singleSignOns; + + /** + * Gets the SingleSignOnsClient object to access its operations. + * + * @return the SingleSignOnsClient object. + */ + public SingleSignOnsClient getSingleSignOns() { + return this.singleSignOns; + } + + /** + * Initializes an instance of DynatraceObservability client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + DynatraceObservabilityImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-09-01-preview"; + this.monitors = new MonitorsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.tagRules = new TagRulesClientImpl(this); + this.singleSignOns = new SingleSignOnsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DynatraceObservabilityImpl.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceSingleSignOnResourceImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceSingleSignOnResourceImpl.java new file mode 100644 index 000000000000..9157e442678b --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/DynatraceSingleSignOnResourceImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner; +import com.azure.resourcemanager.dynatrace.models.DynatraceSingleSignOnResource; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.SingleSignOnStates; +import java.util.Collections; +import java.util.List; + +public final class DynatraceSingleSignOnResourceImpl + implements DynatraceSingleSignOnResource, + DynatraceSingleSignOnResource.Definition, + DynatraceSingleSignOnResource.Update { + private DynatraceSingleSignOnResourceInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SingleSignOnStates singleSignOnState() { + return this.innerModel().singleSignOnState(); + } + + public String enterpriseAppId() { + return this.innerModel().enterpriseAppId(); + } + + public String singleSignOnUrl() { + return this.innerModel().singleSignOnUrl(); + } + + public List aadDomains() { + List inner = this.innerModel().aadDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DynatraceSingleSignOnResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private String configurationName; + + public DynatraceSingleSignOnResourceImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + public DynatraceSingleSignOnResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getSingleSignOns() + .createOrUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public DynatraceSingleSignOnResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSingleSignOns() + .createOrUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), context); + return this; + } + + DynatraceSingleSignOnResourceImpl( + String name, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = new DynatraceSingleSignOnResourceInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public DynatraceSingleSignOnResourceImpl update() { + return this; + } + + public DynatraceSingleSignOnResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSingleSignOns() + .createOrUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public DynatraceSingleSignOnResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSingleSignOns() + .createOrUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), context); + return this; + } + + DynatraceSingleSignOnResourceImpl( + DynatraceSingleSignOnResourceInner innerObject, + com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + this.configurationName = Utils.getValueFromIdByName(innerObject.id(), "singleSignOnConfigurations"); + } + + public DynatraceSingleSignOnResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSingleSignOns() + .getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public DynatraceSingleSignOnResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSingleSignOns() + .getWithResponse(resourceGroupName, monitorName, configurationName, context) + .getValue(); + return this; + } + + public DynatraceSingleSignOnResourceImpl withSingleSignOnState(SingleSignOnStates singleSignOnState) { + this.innerModel().withSingleSignOnState(singleSignOnState); + return this; + } + + public DynatraceSingleSignOnResourceImpl withEnterpriseAppId(String enterpriseAppId) { + this.innerModel().withEnterpriseAppId(enterpriseAppId); + return this; + } + + public DynatraceSingleSignOnResourceImpl withSingleSignOnUrl(String singleSignOnUrl) { + this.innerModel().withSingleSignOnUrl(singleSignOnUrl); + return this; + } + + public DynatraceSingleSignOnResourceImpl withAadDomains(List aadDomains) { + this.innerModel().withAadDomains(aadDomains); + return this; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/LinkableEnvironmentResponseImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/LinkableEnvironmentResponseImpl.java new file mode 100644 index 000000000000..10e9ee843a9b --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/LinkableEnvironmentResponseImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentResponse; +import com.azure.resourcemanager.dynatrace.models.PlanData; + +public final class LinkableEnvironmentResponseImpl implements LinkableEnvironmentResponse { + private LinkableEnvironmentResponseInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + LinkableEnvironmentResponseImpl( + LinkableEnvironmentResponseInner innerObject, + com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public String environmentName() { + return this.innerModel().environmentName(); + } + + public PlanData planData() { + return this.innerModel().planData(); + } + + public LinkableEnvironmentResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorResourceImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorResourceImpl.java new file mode 100644 index 000000000000..73a6b79956a3 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorResourceImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner; +import com.azure.resourcemanager.dynatrace.models.AccountInfoSecure; +import com.azure.resourcemanager.dynatrace.models.AppServiceInfo; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.IdentityProperties; +import com.azure.resourcemanager.dynatrace.models.LiftrResourceCategories; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentRequest; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentResponse; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitorResource; +import com.azure.resourcemanager.dynatrace.models.MonitorResourceUpdate; +import com.azure.resourcemanager.dynatrace.models.MonitoredResource; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsRequest; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsResponse; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import com.azure.resourcemanager.dynatrace.models.VMExtensionPayload; +import com.azure.resourcemanager.dynatrace.models.VMInfo; +import java.util.Collections; +import java.util.Map; + +public final class MonitorResourceImpl implements MonitorResource, MonitorResource.Definition, MonitorResource.Update { + private MonitorResourceInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public MonitoringStatus monitoringStatus() { + return this.innerModel().monitoringStatus(); + } + + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.innerModel().marketplaceSubscriptionStatus(); + } + + public DynatraceEnvironmentProperties dynatraceEnvironmentProperties() { + return this.innerModel().dynatraceEnvironmentProperties(); + } + + public UserInfo userInfo() { + return this.innerModel().userInfo(); + } + + public PlanData planData() { + return this.innerModel().planData(); + } + + public LiftrResourceCategories liftrResourceCategory() { + return this.innerModel().liftrResourceCategory(); + } + + public Integer liftrResourcePreference() { + return this.innerModel().liftrResourcePreference(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public MonitorResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private MonitorResourceUpdate updateResource; + + public MonitorResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MonitorResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .createOrUpdate(resourceGroupName, monitorName, this.innerModel(), Context.NONE); + return this; + } + + public MonitorResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .createOrUpdate(resourceGroupName, monitorName, this.innerModel(), context); + return this; + } + + MonitorResourceImpl(String name, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = new MonitorResourceInner(); + this.serviceManager = serviceManager; + this.monitorName = name; + } + + public MonitorResourceImpl update() { + this.updateResource = new MonitorResourceUpdate(); + return this; + } + + public MonitorResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateResource, Context.NONE) + .getValue(); + return this; + } + + public MonitorResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateResource, context) + .getValue(); + return this; + } + + MonitorResourceImpl( + MonitorResourceInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + } + + public MonitorResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE) + .getValue(); + return this; + } + + public MonitorResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, context) + .getValue(); + return this; + } + + public AccountInfoSecure getAccountCredentials() { + return serviceManager.monitors().getAccountCredentials(resourceGroupName, monitorName); + } + + public Response getAccountCredentialsWithResponse(Context context) { + return serviceManager.monitors().getAccountCredentialsWithResponse(resourceGroupName, monitorName, context); + } + + public PagedIterable listMonitoredResources() { + return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName); + } + + public PagedIterable listMonitoredResources(Context context) { + return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName, context); + } + + public VMExtensionPayload getVMHostPayload() { + return serviceManager.monitors().getVMHostPayload(resourceGroupName, monitorName); + } + + public Response getVMHostPayloadWithResponse(Context context) { + return serviceManager.monitors().getVMHostPayloadWithResponse(resourceGroupName, monitorName, context); + } + + public PagedIterable listHosts() { + return serviceManager.monitors().listHosts(resourceGroupName, monitorName); + } + + public PagedIterable listHosts(Context context) { + return serviceManager.monitors().listHosts(resourceGroupName, monitorName, context); + } + + public PagedIterable listAppServices() { + return serviceManager.monitors().listAppServices(resourceGroupName, monitorName); + } + + public PagedIterable listAppServices(Context context) { + return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, context); + } + + public SsoDetailsResponse getSsoDetails() { + return serviceManager.monitors().getSsoDetails(resourceGroupName, monitorName); + } + + public Response getSsoDetailsWithResponse(SsoDetailsRequest request, Context context) { + return serviceManager.monitors().getSsoDetailsWithResponse(resourceGroupName, monitorName, request, context); + } + + public PagedIterable listLinkableEnvironments(LinkableEnvironmentRequest request) { + return serviceManager.monitors().listLinkableEnvironments(resourceGroupName, monitorName, request); + } + + public PagedIterable listLinkableEnvironments( + LinkableEnvironmentRequest request, Context context) { + return serviceManager.monitors().listLinkableEnvironments(resourceGroupName, monitorName, request, context); + } + + public MonitorResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MonitorResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MonitorResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateResource.withTags(tags); + return this; + } + } + + public MonitorResourceImpl withIdentity(IdentityProperties identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public MonitorResourceImpl withMonitoringStatus(MonitoringStatus monitoringStatus) { + if (isInCreateMode()) { + this.innerModel().withMonitoringStatus(monitoringStatus); + return this; + } else { + this.updateResource.withMonitoringStatus(monitoringStatus); + return this; + } + } + + public MonitorResourceImpl withMarketplaceSubscriptionStatus( + MarketplaceSubscriptionStatus marketplaceSubscriptionStatus) { + if (isInCreateMode()) { + this.innerModel().withMarketplaceSubscriptionStatus(marketplaceSubscriptionStatus); + return this; + } else { + this.updateResource.withMarketplaceSubscriptionStatus(marketplaceSubscriptionStatus); + return this; + } + } + + public MonitorResourceImpl withDynatraceEnvironmentProperties( + DynatraceEnvironmentProperties dynatraceEnvironmentProperties) { + if (isInCreateMode()) { + this.innerModel().withDynatraceEnvironmentProperties(dynatraceEnvironmentProperties); + return this; + } else { + this.updateResource.withDynatraceEnvironmentProperties(dynatraceEnvironmentProperties); + return this; + } + } + + public MonitorResourceImpl withUserInfo(UserInfo userInfo) { + if (isInCreateMode()) { + this.innerModel().withUserInfo(userInfo); + return this; + } else { + this.updateResource.withUserInfo(userInfo); + return this; + } + } + + public MonitorResourceImpl withPlanData(PlanData planData) { + if (isInCreateMode()) { + this.innerModel().withPlanData(planData); + return this; + } else { + this.updateResource.withPlanData(planData); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitoredResourceImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitoredResourceImpl.java new file mode 100644 index 000000000000..da5583912a6f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitoredResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner; +import com.azure.resourcemanager.dynatrace.models.MonitoredResource; +import com.azure.resourcemanager.dynatrace.models.SendingLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendingMetricsStatus; + +public final class MonitoredResourceImpl implements MonitoredResource { + private MonitoredResourceInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + MonitoredResourceImpl( + MonitoredResourceInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public SendingMetricsStatus sendingMetrics() { + return this.innerModel().sendingMetrics(); + } + + public String reasonForMetricsStatus() { + return this.innerModel().reasonForMetricsStatus(); + } + + public SendingLogsStatus sendingLogs() { + return this.innerModel().sendingLogs(); + } + + public String reasonForLogsStatus() { + return this.innerModel().reasonForLogsStatus(); + } + + public MonitoredResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorsClientImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorsClientImpl.java new file mode 100644 index 000000000000..992363f15418 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorsClientImpl.java @@ -0,0 +1,3149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dynatrace.fluent.MonitorsClient; +import com.azure.resourcemanager.dynatrace.fluent.models.AccountInfoSecureInner; +import com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner; +import com.azure.resourcemanager.dynatrace.fluent.models.SsoDetailsResponseInner; +import com.azure.resourcemanager.dynatrace.fluent.models.VMExtensionPayloadInner; +import com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner; +import com.azure.resourcemanager.dynatrace.models.AppServiceListResponse; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentListResponse; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentRequest; +import com.azure.resourcemanager.dynatrace.models.MonitorResourceListResult; +import com.azure.resourcemanager.dynatrace.models.MonitorResourceUpdate; +import com.azure.resourcemanager.dynatrace.models.MonitoredResourceListResponse; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsRequest; +import com.azure.resourcemanager.dynatrace.models.VMHostsListResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +public final class MonitorsClientImpl implements MonitorsClient { + /** The proxy service used to perform REST calls. */ + private final MonitorsService service; + + /** The service client containing this operation class. */ + private final DynatraceObservabilityImpl client; + + /** + * Initializes an instance of MonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MonitorsClientImpl(DynatraceObservabilityImpl client) { + this.service = RestProxy.create(MonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DynatraceObservabilityMonitors to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DynatraceObservabili") + private interface MonitorsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/getAccountCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAccountCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/listMonitoredResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMonitoredResources( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/getVMHostPayload") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVMHostPayload( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MonitorResourceInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MonitorResourceUpdate resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Dynatrace.Observability/monitors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/listHosts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listHosts( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/listAppServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAppServices( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/getSSODetails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSsoDetails( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SsoDetailsRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/listLinkableEnvironments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkableEnvironments( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") LinkableEnvironmentRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMonitoredResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionIdNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listHostsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAppServicesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkableEnvironmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccountCredentialsWithResponseAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAccountCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccountCredentialsWithResponseAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAccountCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAccountCredentialsAsync(String resourceGroupName, String monitorName) { + return getAccountCredentialsWithResponseAsync(resourceGroupName, monitorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInfoSecureInner getAccountCredentials(String resourceGroupName, String monitorName) { + return getAccountCredentialsAsync(resourceGroupName, monitorName).block(); + } + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccountCredentialsWithResponse( + String resourceGroupName, String monitorName, Context context) { + return getAccountCredentialsWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoredResourcesSinglePageAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listMonitoredResources( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoredResourcesSinglePageAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMonitoredResources( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMonitoredResourcesAsync( + String resourceGroupName, String monitorName) { + return new PagedFlux<>( + () -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink)); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMonitoredResourcesAsync( + String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>( + () -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink, context)); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName)); + } + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMonitoredResources( + String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName, context)); + } + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVMHostPayloadWithResponseAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVMHostPayload( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVMHostPayloadWithResponseAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVMHostPayload( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVMHostPayloadAsync(String resourceGroupName, String monitorName) { + return getVMHostPayloadWithResponseAsync(resourceGroupName, monitorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VMExtensionPayloadInner getVMHostPayload(String resourceGroupName, String monitorName) { + return getVMHostPayloadAsync(resourceGroupName, monitorName).block(); + } + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVMHostPayloadWithResponse( + String resourceGroupName, String monitorName, Context context) { + return getVMHostPayloadWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String monitorName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName) { + return getByResourceGroupAsync(resourceGroupName, monitorName).block(); + } + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String monitorName, MonitorResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + resource, + accept, + context); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitorResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String monitorName, MonitorResourceInner resource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitorResourceInner.class, + MonitorResourceInner.class, + this.client.getContext()); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitorResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MonitorResourceInner.class, MonitorResourceInner.class, context); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitorResourceInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource).getSyncPoller(); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitorResourceInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context).getSyncPoller(); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String monitorName, MonitorResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorResourceInner createOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, monitorName, resource).block(); + } + + /** + * Create a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorResourceInner createOrUpdate( + String resourceGroupName, String monitorName, MonitorResourceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, monitorName, resource, context).block(); + } + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, MonitorResourceUpdate resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, MonitorResourceUpdate resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + resource, + accept, + context); + } + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String monitorName, MonitorResourceUpdate resource) { + return updateWithResponseAsync(resourceGroupName, monitorName, resource) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorResourceInner update(String resourceGroupName, String monitorName, MonitorResourceUpdate resource) { + return updateAsync(resourceGroupName, monitorName, resource).block(); + } + + /** + * Update a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param resource The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dynatrace Monitor Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String monitorName, MonitorResourceUpdate resource, Context context) { + return updateWithResponseAsync(resourceGroupName, monitorName, resource, context).block(); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName) { + return beginDeleteAsync(resourceGroupName, monitorName).getSyncPoller(); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, context).getSyncPoller(); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName) { + return beginDeleteAsync(resourceGroupName, monitorName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName) { + deleteAsync(resourceGroupName, monitorName).block(); + } + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, Context context) { + deleteAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * List all MonitorResource by subscriptionId. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all MonitorResource by subscriptionId. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all MonitorResource by subscriptionId. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); + } + + /** + * List all MonitorResource by subscriptionId. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context)); + } + + /** + * List all MonitorResource by subscriptionId. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all MonitorResource by subscriptionId. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHostsSinglePageAsync(String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listHosts( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHostsSinglePageAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listHosts( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listHostsAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>( + () -> listHostsSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listHostsNextSinglePageAsync(nextLink)); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listHostsAsync(String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>( + () -> listHostsSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listHostsNextSinglePageAsync(nextLink, context)); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listHosts(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName)); + } + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listHosts(String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName, context)); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAppServicesSinglePageAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAppServices( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAppServicesSinglePageAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAppServices( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAppServicesAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>( + () -> listAppServicesSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listAppServicesNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAppServicesAsync( + String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>( + () -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listAppServicesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAppServices(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName)); + } + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAppServices( + String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, context)); + } + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the get sso details request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSsoDetailsWithResponseAsync( + String resourceGroupName, String monitorName, SsoDetailsRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request != null) { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSsoDetails( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + request, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the get sso details request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSsoDetailsWithResponseAsync( + String resourceGroupName, String monitorName, SsoDetailsRequest request, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request != null) { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSsoDetails( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + request, + accept, + context); + } + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the get sso details request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSsoDetailsAsync( + String resourceGroupName, String monitorName, SsoDetailsRequest request) { + return getSsoDetailsWithResponseAsync(resourceGroupName, monitorName, request) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSsoDetailsAsync(String resourceGroupName, String monitorName) { + final SsoDetailsRequest request = null; + return getSsoDetailsWithResponseAsync(resourceGroupName, monitorName, request) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsoDetailsResponseInner getSsoDetails(String resourceGroupName, String monitorName) { + final SsoDetailsRequest request = null; + return getSsoDetailsAsync(resourceGroupName, monitorName, request).block(); + } + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the get sso details request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSsoDetailsWithResponse( + String resourceGroupName, String monitorName, SsoDetailsRequest request, Context context) { + return getSsoDetailsWithResponseAsync(resourceGroupName, monitorName, request, context).block(); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkableEnvironmentsSinglePageAsync( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLinkableEnvironments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + request, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkableEnvironmentsSinglePageAsync( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLinkableEnvironments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + request, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLinkableEnvironmentsAsync( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request) { + return new PagedFlux<>( + () -> listLinkableEnvironmentsSinglePageAsync(resourceGroupName, monitorName, request), + nextLink -> listLinkableEnvironmentsNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLinkableEnvironmentsAsync( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request, Context context) { + return new PagedFlux<>( + () -> listLinkableEnvironmentsSinglePageAsync(resourceGroupName, monitorName, request, context), + nextLink -> listLinkableEnvironmentsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request) { + return new PagedIterable<>(listLinkableEnvironmentsAsync(resourceGroupName, monitorName, request)); + } + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request, Context context) { + return new PagedIterable<>(listLinkableEnvironmentsAsync(resourceGroupName, monitorName, request, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoredResourcesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionIdNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionIdNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHostsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listHostsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHostsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listHostsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list App Services Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAppServicesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list App Services Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAppServicesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for getting all the linkable environments along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkableEnvironmentsNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listLinkableEnvironmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for getting all the linkable environments along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLinkableEnvironmentsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLinkableEnvironmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorsImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorsImpl.java new file mode 100644 index 000000000000..dc156af635fe --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/MonitorsImpl.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.MonitorsClient; +import com.azure.resourcemanager.dynatrace.fluent.models.AccountInfoSecureInner; +import com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner; +import com.azure.resourcemanager.dynatrace.fluent.models.SsoDetailsResponseInner; +import com.azure.resourcemanager.dynatrace.fluent.models.VMExtensionPayloadInner; +import com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner; +import com.azure.resourcemanager.dynatrace.models.AccountInfoSecure; +import com.azure.resourcemanager.dynatrace.models.AppServiceInfo; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentRequest; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentResponse; +import com.azure.resourcemanager.dynatrace.models.MonitorResource; +import com.azure.resourcemanager.dynatrace.models.MonitoredResource; +import com.azure.resourcemanager.dynatrace.models.Monitors; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsRequest; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsResponse; +import com.azure.resourcemanager.dynatrace.models.VMExtensionPayload; +import com.azure.resourcemanager.dynatrace.models.VMInfo; + +public final class MonitorsImpl implements Monitors { + private static final ClientLogger LOGGER = new ClientLogger(MonitorsImpl.class); + + private final MonitorsClient innerClient; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public MonitorsImpl( + MonitorsClient innerClient, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AccountInfoSecure getAccountCredentials(String resourceGroupName, String monitorName) { + AccountInfoSecureInner inner = this.serviceClient().getAccountCredentials(resourceGroupName, monitorName); + if (inner != null) { + return new AccountInfoSecureImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAccountCredentialsWithResponse( + String resourceGroupName, String monitorName, Context context) { + Response inner = + this.serviceClient().getAccountCredentialsWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccountInfoSecureImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { + PagedIterable inner = + this.serviceClient().listMonitoredResources(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); + } + + public PagedIterable listMonitoredResources( + String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = + this.serviceClient().listMonitoredResources(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); + } + + public VMExtensionPayload getVMHostPayload(String resourceGroupName, String monitorName) { + VMExtensionPayloadInner inner = this.serviceClient().getVMHostPayload(resourceGroupName, monitorName); + if (inner != null) { + return new VMExtensionPayloadImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVMHostPayloadWithResponse( + String resourceGroupName, String monitorName, Context context) { + Response inner = + this.serviceClient().getVMHostPayloadWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VMExtensionPayloadImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MonitorResource getByResourceGroup(String resourceGroupName, String monitorName) { + MonitorResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, monitorName); + if (inner != null) { + return new MonitorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MonitorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String monitorName) { + this.serviceClient().delete(resourceGroupName, monitorName); + } + + public void delete(String resourceGroupName, String monitorName, Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new MonitorResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new MonitorResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new MonitorResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new MonitorResourceImpl(inner1, this.manager())); + } + + public PagedIterable listHosts(String resourceGroupName, String monitorName) { + PagedIterable inner = this.serviceClient().listHosts(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); + } + + public PagedIterable listHosts(String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = this.serviceClient().listHosts(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); + } + + public PagedIterable listAppServices(String resourceGroupName, String monitorName) { + PagedIterable inner = this.serviceClient().listAppServices(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + } + + public PagedIterable listAppServices( + String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = + this.serviceClient().listAppServices(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + } + + public SsoDetailsResponse getSsoDetails(String resourceGroupName, String monitorName) { + SsoDetailsResponseInner inner = this.serviceClient().getSsoDetails(resourceGroupName, monitorName); + if (inner != null) { + return new SsoDetailsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSsoDetailsWithResponse( + String resourceGroupName, String monitorName, SsoDetailsRequest request, Context context) { + Response inner = + this.serviceClient().getSsoDetailsWithResponse(resourceGroupName, monitorName, request, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SsoDetailsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request) { + PagedIterable inner = + this.serviceClient().listLinkableEnvironments(resourceGroupName, monitorName, request); + return Utils.mapPage(inner, inner1 -> new LinkableEnvironmentResponseImpl(inner1, this.manager())); + } + + public PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request, Context context) { + PagedIterable inner = + this.serviceClient().listLinkableEnvironments(resourceGroupName, monitorName, request, context); + return Utils.mapPage(inner, inner1 -> new LinkableEnvironmentResponseImpl(inner1, this.manager())); + } + + public MonitorResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + this.delete(resourceGroupName, monitorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + this.delete(resourceGroupName, monitorName, context); + } + + private MonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } + + public MonitorResourceImpl define(String name) { + return new MonitorResourceImpl(name, this.manager()); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationImpl.java new file mode 100644 index 000000000000..00c87d1ef60b --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.OperationInner; +import com.azure.resourcemanager.dynatrace.models.ActionType; +import com.azure.resourcemanager.dynatrace.models.Operation; +import com.azure.resourcemanager.dynatrace.models.OperationDisplay; +import com.azure.resourcemanager.dynatrace.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationsClientImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..7c0a8d33c920 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationsClientImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dynatrace.fluent.OperationsClient; +import com.azure.resourcemanager.dynatrace.fluent.models.OperationInner; +import com.azure.resourcemanager.dynatrace.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final DynatraceObservabilityImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DynatraceObservabilityImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DynatraceObservabilityOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DynatraceObservabili") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Dynatrace.Observability/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the operations for Dynatrace.Observability. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for Dynatrace.Observability. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the operations for Dynatrace.Observability. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for Dynatrace.Observability. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for Dynatrace.Observability. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for Dynatrace.Observability. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationsImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationsImpl.java new file mode 100644 index 000000000000..38d9757c5faf --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.OperationsClient; +import com.azure.resourcemanager.dynatrace.fluent.models.OperationInner; +import com.azure.resourcemanager.dynatrace.models.Operation; +import com.azure.resourcemanager.dynatrace.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SingleSignOnsClientImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SingleSignOnsClientImpl.java new file mode 100644 index 000000000000..e3fcd78a33a5 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SingleSignOnsClientImpl.java @@ -0,0 +1,882 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dynatrace.fluent.SingleSignOnsClient; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner; +import com.azure.resourcemanager.dynatrace.models.DynatraceSingleSignOnResourceListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SingleSignOnsClient. */ +public final class SingleSignOnsClientImpl implements SingleSignOnsClient { + /** The proxy service used to perform REST calls. */ + private final SingleSignOnsService service; + + /** The service client containing this operation class. */ + private final DynatraceObservabilityImpl client; + + /** + * Initializes an instance of SingleSignOnsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SingleSignOnsClientImpl(DynatraceObservabilityImpl client) { + this.service = + RestProxy.create(SingleSignOnsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DynatraceObservabilitySingleSignOns to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DynatraceObservabili") + private interface SingleSignOnsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") DynatraceSingleSignOnResourceInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("configurationName") String configurationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/singleSignOnConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + resource, + accept, + context); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynatraceSingleSignOnResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, resource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DynatraceSingleSignOnResourceInner.class, + DynatraceSingleSignOnResourceInner.class, + this.client.getContext()); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynatraceSingleSignOnResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, resource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DynatraceSingleSignOnResourceInner.class, + DynatraceSingleSignOnResourceInner.class, + context); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynatraceSingleSignOnResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, configurationName, resource).getSyncPoller(); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynatraceSingleSignOnResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, configurationName, resource, context) + .getSyncPoller(); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, configurationName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, configurationName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynatraceSingleSignOnResourceInner createOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, monitorName, configurationName, resource).block(); + } + + /** + * Create a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single sign-on configurations for a given monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynatraceSingleSignOnResourceInner createOrUpdate( + String resourceGroupName, + String monitorName, + String configurationName, + DynatraceSingleSignOnResourceInner resource, + Context context) { + return createOrUpdateAsync(resourceGroupName, monitorName, configurationName, resource, context).block(); + } + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + configurationName, + accept, + context); + } + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String monitorName, String configurationName) { + return getWithResponseAsync(resourceGroupName, monitorName, configurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynatraceSingleSignOnResourceInner get( + String resourceGroupName, String monitorName, String configurationName) { + return getAsync(resourceGroupName, monitorName, configurationName).block(); + } + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, configurationName, context).block(); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, monitorName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName)); + } + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SingleSignOnsImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SingleSignOnsImpl.java new file mode 100644 index 000000000000..41b051b07feb --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SingleSignOnsImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.SingleSignOnsClient; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner; +import com.azure.resourcemanager.dynatrace.models.DynatraceSingleSignOnResource; +import com.azure.resourcemanager.dynatrace.models.SingleSignOns; + +public final class SingleSignOnsImpl implements SingleSignOns { + private static final ClientLogger LOGGER = new ClientLogger(SingleSignOnsImpl.class); + + private final SingleSignOnsClient innerClient; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public SingleSignOnsImpl( + SingleSignOnsClient innerClient, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DynatraceSingleSignOnResource get(String resourceGroupName, String monitorName, String configurationName) { + DynatraceSingleSignOnResourceInner inner = + this.serviceClient().get(resourceGroupName, monitorName, configurationName); + if (inner != null) { + return new DynatraceSingleSignOnResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, monitorName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DynatraceSingleSignOnResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String monitorName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new DynatraceSingleSignOnResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new DynatraceSingleSignOnResourceImpl(inner1, this.manager())); + } + + public DynatraceSingleSignOnResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "singleSignOnConfigurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'singleSignOnConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, monitorName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "singleSignOnConfigurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'singleSignOnConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, monitorName, configurationName, context); + } + + private SingleSignOnsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } + + public DynatraceSingleSignOnResourceImpl define(String name) { + return new DynatraceSingleSignOnResourceImpl(name, this.manager()); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SsoDetailsResponseImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SsoDetailsResponseImpl.java new file mode 100644 index 000000000000..ff4f932ae4d5 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/SsoDetailsResponseImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.SsoDetailsResponseInner; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsResponse; +import com.azure.resourcemanager.dynatrace.models.SsoStatus; +import java.util.Collections; +import java.util.List; + +public final class SsoDetailsResponseImpl implements SsoDetailsResponse { + private SsoDetailsResponseInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + SsoDetailsResponseImpl( + SsoDetailsResponseInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SsoStatus isSsoEnabled() { + return this.innerModel().isSsoEnabled(); + } + + public String metadataUrl() { + return this.innerModel().metadataUrl(); + } + + public String singleSignOnUrl() { + return this.innerModel().singleSignOnUrl(); + } + + public List aadDomains() { + List inner = this.innerModel().aadDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List adminUsers() { + List inner = this.innerModel().adminUsers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SsoDetailsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRuleImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRuleImpl.java new file mode 100644 index 000000000000..d256116a9c9f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRuleImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.ProvisioningState; +import com.azure.resourcemanager.dynatrace.models.TagRule; +import com.azure.resourcemanager.dynatrace.models.TagRuleUpdate; + +public final class TagRuleImpl implements TagRule, TagRule.Definition, TagRule.Update { + private TagRuleInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public LogRules logRules() { + return this.innerModel().logRules(); + } + + public MetricRules metricRules() { + return this.innerModel().metricRules(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public TagRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private String ruleSetName; + + private TagRuleUpdate updateResource; + + public TagRuleImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + public TagRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getTagRules() + .createOrUpdate(resourceGroupName, monitorName, ruleSetName, this.innerModel(), Context.NONE); + return this; + } + + public TagRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTagRules() + .createOrUpdate(resourceGroupName, monitorName, ruleSetName, this.innerModel(), context); + return this; + } + + TagRuleImpl(String name, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = new TagRuleInner(); + this.serviceManager = serviceManager; + this.ruleSetName = name; + } + + public TagRuleImpl update() { + this.updateResource = new TagRuleUpdate(); + return this; + } + + public TagRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTagRules() + .updateWithResponse(resourceGroupName, monitorName, ruleSetName, updateResource, Context.NONE) + .getValue(); + return this; + } + + public TagRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTagRules() + .updateWithResponse(resourceGroupName, monitorName, ruleSetName, updateResource, context) + .getValue(); + return this; + } + + TagRuleImpl(TagRuleInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + this.ruleSetName = Utils.getValueFromIdByName(innerObject.id(), "tagRules"); + } + + public TagRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTagRules() + .getWithResponse(resourceGroupName, monitorName, ruleSetName, Context.NONE) + .getValue(); + return this; + } + + public TagRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTagRules() + .getWithResponse(resourceGroupName, monitorName, ruleSetName, context) + .getValue(); + return this; + } + + public TagRuleImpl withLogRules(LogRules logRules) { + if (isInCreateMode()) { + this.innerModel().withLogRules(logRules); + return this; + } else { + this.updateResource.withLogRules(logRules); + return this; + } + } + + public TagRuleImpl withMetricRules(MetricRules metricRules) { + if (isInCreateMode()) { + this.innerModel().withMetricRules(metricRules); + return this; + } else { + this.updateResource.withMetricRules(metricRules); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRulesClientImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRulesClientImpl.java new file mode 100644 index 000000000000..cd9b3217bc56 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRulesClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dynatrace.fluent.TagRulesClient; +import com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner; +import com.azure.resourcemanager.dynatrace.models.TagRuleListResult; +import com.azure.resourcemanager.dynatrace.models.TagRuleUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TagRulesClient. */ +public final class TagRulesClientImpl implements TagRulesClient { + /** The proxy service used to perform REST calls. */ + private final TagRulesService service; + + /** The service client containing this operation class. */ + private final DynatraceObservabilityImpl client; + + /** + * Initializes an instance of TagRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TagRulesClientImpl(DynatraceObservabilityImpl client) { + this.service = RestProxy.create(TagRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DynatraceObservabilityTagRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DynatraceObservabili") + private interface TagRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, + @BodyParam("application/json") TagRuleInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, + @BodyParam("application/json") TagRuleUpdate resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability" + + "/monitors/{monitorName}/tagRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + accept, + context); + } + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String monitorName, String ruleSetName) { + return getWithResponseAsync(resourceGroupName, monitorName, ruleSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagRuleInner get(String resourceGroupName, String monitorName, String ruleSetName) { + return getAsync(resourceGroupName, monitorName, ruleSetName).block(); + } + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String monitorName, String ruleSetName, Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context).block(); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + resource, + accept, + context); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TagRuleInner.class, TagRuleInner.class, this.client.getContext()); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TagRuleInner.class, TagRuleInner.class, context); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagRuleInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).getSyncPoller(); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagRuleInner> beginCreateOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context).getSyncPoller(); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagRuleInner createOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { + return createOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).block(); + } + + /** + * Create a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagRuleInner createOrUpdate( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context).block(); + } + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + resource, + accept, + context); + } + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource) { + return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagRuleInner update( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource) { + return updateAsync(resourceGroupName, monitorName, ruleSetName, resource).block(); + } + + /** + * Update a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param resource The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag rules for a monitor resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdate resource, Context context) { + return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource, context).block(); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, String ruleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + ruleSetName, + accept, + context); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, String ruleSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, String ruleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String ruleSetName) { + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName).getSyncPoller(); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String ruleSetName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context).getSyncPoller(); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName) { + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, String ruleSetName) { + deleteAsync(resourceGroupName, monitorName, ruleSetName).block(); + } + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context) { + deleteAsync(resourceGroupName, monitorName, ruleSetName, context).block(); + } + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String monitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, monitorName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName)); + } + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRulesImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRulesImpl.java new file mode 100644 index 000000000000..58618e0384e2 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/TagRulesImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.TagRulesClient; +import com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner; +import com.azure.resourcemanager.dynatrace.models.TagRule; +import com.azure.resourcemanager.dynatrace.models.TagRules; + +public final class TagRulesImpl implements TagRules { + private static final ClientLogger LOGGER = new ClientLogger(TagRulesImpl.class); + + private final TagRulesClient innerClient; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + public TagRulesImpl( + TagRulesClient innerClient, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public TagRule get(String resourceGroupName, String monitorName, String ruleSetName) { + TagRuleInner inner = this.serviceClient().get(resourceGroupName, monitorName, ruleSetName); + if (inner != null) { + return new TagRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String monitorName, String ruleSetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, monitorName, ruleSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String monitorName, String ruleSetName) { + this.serviceClient().delete(resourceGroupName, monitorName, ruleSetName); + } + + public void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, ruleSetName, context); + } + + public PagedIterable list(String resourceGroupName, String monitorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new TagRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new TagRuleImpl(inner1, this.manager())); + } + + public TagRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + } + return this.getWithResponse(resourceGroupName, monitorName, ruleSetName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + } + return this.getWithResponse(resourceGroupName, monitorName, ruleSetName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + } + this.delete(resourceGroupName, monitorName, ruleSetName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String ruleSetName = Utils.getValueFromIdByName(id, "tagRules"); + if (ruleSetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tagRules'.", id))); + } + this.delete(resourceGroupName, monitorName, ruleSetName, context); + } + + private TagRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } + + public TagRuleImpl define(String name) { + return new TagRuleImpl(name, this.manager()); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/Utils.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/Utils.java new file mode 100644 index 000000000000..f5ddbc7e26ad --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/VMExtensionPayloadImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/VMExtensionPayloadImpl.java new file mode 100644 index 000000000000..ea75947c0a81 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/VMExtensionPayloadImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.VMExtensionPayloadInner; +import com.azure.resourcemanager.dynatrace.models.VMExtensionPayload; + +public final class VMExtensionPayloadImpl implements VMExtensionPayload { + private VMExtensionPayloadInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + VMExtensionPayloadImpl( + VMExtensionPayloadInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String ingestionKey() { + return this.innerModel().ingestionKey(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public VMExtensionPayloadInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/VMInfoImpl.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/VMInfoImpl.java new file mode 100644 index 000000000000..eafc81557b6a --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/VMInfoImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.implementation; + +import com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner; +import com.azure.resourcemanager.dynatrace.models.AutoUpdateSetting; +import com.azure.resourcemanager.dynatrace.models.AvailabilityState; +import com.azure.resourcemanager.dynatrace.models.LogModule; +import com.azure.resourcemanager.dynatrace.models.MonitoringType; +import com.azure.resourcemanager.dynatrace.models.UpdateStatus; +import com.azure.resourcemanager.dynatrace.models.VMInfo; + +public final class VMInfoImpl implements VMInfo { + private VMInfoInner innerObject; + + private final com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager; + + VMInfoImpl(VMInfoInner innerObject, com.azure.resourcemanager.dynatrace.DynatraceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String version() { + return this.innerModel().version(); + } + + public MonitoringType monitoringType() { + return this.innerModel().monitoringType(); + } + + public AutoUpdateSetting autoUpdateSetting() { + return this.innerModel().autoUpdateSetting(); + } + + public UpdateStatus updateStatus() { + return this.innerModel().updateStatus(); + } + + public AvailabilityState availabilityState() { + return this.innerModel().availabilityState(); + } + + public LogModule logModule() { + return this.innerModel().logModule(); + } + + public String hostGroup() { + return this.innerModel().hostGroup(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public VMInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dynatrace.DynatraceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/package-info.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/package-info.java new file mode 100644 index 000000000000..6ec806d8373c --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for DynatraceObservability. null. */ +package com.azure.resourcemanager.dynatrace.implementation; diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AccountInfo.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AccountInfo.java new file mode 100644 index 000000000000..896017ba890d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AccountInfo.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dynatrace Account Information. */ +@Fluent +public final class AccountInfo { + /* + * Account Id of the account this environment is linked to + */ + @JsonProperty(value = "accountId") + private String accountId; + + /* + * Region in which the account is created + */ + @JsonProperty(value = "regionId") + private String regionId; + + /** + * Get the accountId property: Account Id of the account this environment is linked to. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: Account Id of the account this environment is linked to. + * + * @param accountId the accountId value to set. + * @return the AccountInfo object itself. + */ + public AccountInfo withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the regionId property: Region in which the account is created. + * + * @return the regionId value. + */ + public String regionId() { + return this.regionId; + } + + /** + * Set the regionId property: Region in which the account is created. + * + * @param regionId the regionId value to set. + * @return the AccountInfo object itself. + */ + public AccountInfo withRegionId(String regionId) { + this.regionId = regionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AccountInfoSecure.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AccountInfoSecure.java new file mode 100644 index 000000000000..8caae5f2d4c3 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AccountInfoSecure.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.AccountInfoSecureInner; + +/** An immutable client-side representation of AccountInfoSecure. */ +public interface AccountInfoSecure { + /** + * Gets the accountId property: Account Id of the account this environment is linked to. + * + * @return the accountId value. + */ + String accountId(); + + /** + * Gets the apiKey property: API Key of the user account. + * + * @return the apiKey value. + */ + String apiKey(); + + /** + * Gets the regionId property: Region in which the account is created. + * + * @return the regionId value. + */ + String regionId(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.AccountInfoSecureInner object. + * + * @return the inner object. + */ + AccountInfoSecureInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ActionType.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ActionType.java new file mode 100644 index 000000000000..de4dce56c041 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ActionType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AppServiceInfo.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AppServiceInfo.java new file mode 100644 index 000000000000..2d153cf0e0ad --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AppServiceInfo.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner; + +/** An immutable client-side representation of AppServiceInfo. */ +public interface AppServiceInfo { + /** + * Gets the resourceId property: App service resource ID. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the version property: Version of the Dynatrace agent installed on the App Service. + * + * @return the version value. + */ + String version(); + + /** + * Gets the monitoringType property: The monitoring mode of OneAgent. + * + * @return the monitoringType value. + */ + MonitoringType monitoringType(); + + /** + * Gets the autoUpdateSetting property: Update settings of OneAgent. + * + * @return the autoUpdateSetting value. + */ + AutoUpdateSetting autoUpdateSetting(); + + /** + * Gets the updateStatus property: The current update status of OneAgent. + * + * @return the updateStatus value. + */ + UpdateStatus updateStatus(); + + /** + * Gets the availabilityState property: The availability state of OneAgent. + * + * @return the availabilityState value. + */ + AvailabilityState availabilityState(); + + /** + * Gets the logModule property: Tells whether log modules are enabled or not. + * + * @return the logModule value. + */ + LogModule logModule(); + + /** + * Gets the hostGroup property: The name of the host group. + * + * @return the hostGroup value. + */ + String hostGroup(); + + /** + * Gets the hostname property: The name of the host. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner object. + * + * @return the inner object. + */ + AppServiceInfoInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AppServiceListResponse.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AppServiceListResponse.java new file mode 100644 index 000000000000..01eb59286e4c --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AppServiceListResponse.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.models.AppServiceInfoInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response of a list App Services Operation. */ +@Fluent +public final class AppServiceListResponse { + /* + * The items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink", required = true) + private String nextLink; + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The items on this page. + * + * @param value the value value to set. + * @return the AppServiceListResponse object itself. + */ + public AppServiceListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AppServiceListResponse object itself. + */ + public AppServiceListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AppServiceListResponse")); + } else { + value().forEach(e -> e.validate()); + } + if (nextLink() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextLink in model AppServiceListResponse")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppServiceListResponse.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AutoUpdateSetting.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AutoUpdateSetting.java new file mode 100644 index 000000000000..6a949dca950a --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AutoUpdateSetting.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AutoUpdateSetting. */ +public final class AutoUpdateSetting extends ExpandableStringEnum { + /** Static value ENABLED for AutoUpdateSetting. */ + public static final AutoUpdateSetting ENABLED = fromString("ENABLED"); + + /** Static value DISABLED for AutoUpdateSetting. */ + public static final AutoUpdateSetting DISABLED = fromString("DISABLED"); + + /** + * Creates or finds a AutoUpdateSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoUpdateSetting. + */ + @JsonCreator + public static AutoUpdateSetting fromString(String name) { + return fromString(name, AutoUpdateSetting.class); + } + + /** + * Gets known AutoUpdateSetting values. + * + * @return known AutoUpdateSetting values. + */ + public static Collection values() { + return values(AutoUpdateSetting.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AvailabilityState.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AvailabilityState.java new file mode 100644 index 000000000000..628ca326ea59 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/AvailabilityState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AvailabilityState. */ +public final class AvailabilityState extends ExpandableStringEnum { + /** Static value CRASHED for AvailabilityState. */ + public static final AvailabilityState CRASHED = fromString("CRASHED"); + + /** Static value LOST for AvailabilityState. */ + public static final AvailabilityState LOST = fromString("LOST"); + + /** Static value MONITORED for AvailabilityState. */ + public static final AvailabilityState MONITORED = fromString("MONITORED"); + + /** Static value PRE_MONITORED for AvailabilityState. */ + public static final AvailabilityState PRE_MONITORED = fromString("PRE_MONITORED"); + + /** Static value SHUTDOWN for AvailabilityState. */ + public static final AvailabilityState SHUTDOWN = fromString("SHUTDOWN"); + + /** Static value UNEXPECTED_SHUTDOWN for AvailabilityState. */ + public static final AvailabilityState UNEXPECTED_SHUTDOWN = fromString("UNEXPECTED_SHUTDOWN"); + + /** Static value UNKNOWN for AvailabilityState. */ + public static final AvailabilityState UNKNOWN = fromString("UNKNOWN"); + + /** Static value UNMONITORED for AvailabilityState. */ + public static final AvailabilityState UNMONITORED = fromString("UNMONITORED"); + + /** + * Creates or finds a AvailabilityState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailabilityState. + */ + @JsonCreator + public static AvailabilityState fromString(String name) { + return fromString(name, AvailabilityState.class); + } + + /** + * Gets known AvailabilityState values. + * + * @return known AvailabilityState values. + */ + public static Collection values() { + return values(AvailabilityState.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceEnvironmentProperties.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceEnvironmentProperties.java new file mode 100644 index 000000000000..17f2d598373f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceEnvironmentProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Dynatrace environment. */ +@Fluent +public final class DynatraceEnvironmentProperties { + /* + * User id + */ + @JsonProperty(value = "userId") + private String userId; + + /* + * Dynatrace Account Information + */ + @JsonProperty(value = "accountInfo") + private AccountInfo accountInfo; + + /* + * Dynatrace Environment Information + */ + @JsonProperty(value = "environmentInfo") + private EnvironmentInfo environmentInfo; + + /* + * The details of a Dynatrace single sign-on. + */ + @JsonProperty(value = "singleSignOnProperties") + private DynatraceSingleSignOnProperties singleSignOnProperties; + + /** + * Get the userId property: User id. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: User id. + * + * @param userId the userId value to set. + * @return the DynatraceEnvironmentProperties object itself. + */ + public DynatraceEnvironmentProperties withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Get the accountInfo property: Dynatrace Account Information. + * + * @return the accountInfo value. + */ + public AccountInfo accountInfo() { + return this.accountInfo; + } + + /** + * Set the accountInfo property: Dynatrace Account Information. + * + * @param accountInfo the accountInfo value to set. + * @return the DynatraceEnvironmentProperties object itself. + */ + public DynatraceEnvironmentProperties withAccountInfo(AccountInfo accountInfo) { + this.accountInfo = accountInfo; + return this; + } + + /** + * Get the environmentInfo property: Dynatrace Environment Information. + * + * @return the environmentInfo value. + */ + public EnvironmentInfo environmentInfo() { + return this.environmentInfo; + } + + /** + * Set the environmentInfo property: Dynatrace Environment Information. + * + * @param environmentInfo the environmentInfo value to set. + * @return the DynatraceEnvironmentProperties object itself. + */ + public DynatraceEnvironmentProperties withEnvironmentInfo(EnvironmentInfo environmentInfo) { + this.environmentInfo = environmentInfo; + return this; + } + + /** + * Get the singleSignOnProperties property: The details of a Dynatrace single sign-on. + * + * @return the singleSignOnProperties value. + */ + public DynatraceSingleSignOnProperties singleSignOnProperties() { + return this.singleSignOnProperties; + } + + /** + * Set the singleSignOnProperties property: The details of a Dynatrace single sign-on. + * + * @param singleSignOnProperties the singleSignOnProperties value to set. + * @return the DynatraceEnvironmentProperties object itself. + */ + public DynatraceEnvironmentProperties withSingleSignOnProperties( + DynatraceSingleSignOnProperties singleSignOnProperties) { + this.singleSignOnProperties = singleSignOnProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accountInfo() != null) { + accountInfo().validate(); + } + if (environmentInfo() != null) { + environmentInfo().validate(); + } + if (singleSignOnProperties() != null) { + singleSignOnProperties().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceSingleSignOnResource.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceSingleSignOnResource.java new file mode 100644 index 000000000000..f6258257b476 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceSingleSignOnResource.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner; +import java.util.List; + +/** An immutable client-side representation of DynatraceSingleSignOnResource. */ +public interface DynatraceSingleSignOnResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: System metadata for this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the singleSignOnState property: State of Single Sign On. + * + * @return the singleSignOnState value. + */ + SingleSignOnStates singleSignOnState(); + + /** + * Gets the enterpriseAppId property: Version of the Dynatrace agent installed on the VM. + * + * @return the enterpriseAppId value. + */ + String enterpriseAppId(); + + /** + * Gets the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @return the singleSignOnUrl value. + */ + String singleSignOnUrl(); + + /** + * Gets the aadDomains property: array of Aad(azure active directory) domains. + * + * @return the aadDomains value. + */ + List aadDomains(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner object. + * + * @return the inner object. + */ + DynatraceSingleSignOnResourceInner innerModel(); + + /** The entirety of the DynatraceSingleSignOnResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DynatraceSingleSignOnResource definition stages. */ + interface DefinitionStages { + /** The first stage of the DynatraceSingleSignOnResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DynatraceSingleSignOnResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @return the next definition stage. + */ + WithCreate withExistingMonitor(String resourceGroupName, String monitorName); + } + /** + * The stage of the DynatraceSingleSignOnResource definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithSingleSignOnState, + DefinitionStages.WithEnterpriseAppId, + DefinitionStages.WithSingleSignOnUrl, + DefinitionStages.WithAadDomains { + /** + * Executes the create request. + * + * @return the created resource. + */ + DynatraceSingleSignOnResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DynatraceSingleSignOnResource create(Context context); + } + /** The stage of the DynatraceSingleSignOnResource definition allowing to specify singleSignOnState. */ + interface WithSingleSignOnState { + /** + * Specifies the singleSignOnState property: State of Single Sign On. + * + * @param singleSignOnState State of Single Sign On. + * @return the next definition stage. + */ + WithCreate withSingleSignOnState(SingleSignOnStates singleSignOnState); + } + /** The stage of the DynatraceSingleSignOnResource definition allowing to specify enterpriseAppId. */ + interface WithEnterpriseAppId { + /** + * Specifies the enterpriseAppId property: Version of the Dynatrace agent installed on the VM.. + * + * @param enterpriseAppId Version of the Dynatrace agent installed on the VM. + * @return the next definition stage. + */ + WithCreate withEnterpriseAppId(String enterpriseAppId); + } + /** The stage of the DynatraceSingleSignOnResource definition allowing to specify singleSignOnUrl. */ + interface WithSingleSignOnUrl { + /** + * Specifies the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @param singleSignOnUrl The login URL specific to this Dynatrace Environment. + * @return the next definition stage. + */ + WithCreate withSingleSignOnUrl(String singleSignOnUrl); + } + /** The stage of the DynatraceSingleSignOnResource definition allowing to specify aadDomains. */ + interface WithAadDomains { + /** + * Specifies the aadDomains property: array of Aad(azure active directory) domains. + * + * @param aadDomains array of Aad(azure active directory) domains. + * @return the next definition stage. + */ + WithCreate withAadDomains(List aadDomains); + } + } + /** + * Begins update for the DynatraceSingleSignOnResource resource. + * + * @return the stage of resource update. + */ + DynatraceSingleSignOnResource.Update update(); + + /** The template for DynatraceSingleSignOnResource update. */ + interface Update + extends UpdateStages.WithSingleSignOnState, + UpdateStages.WithEnterpriseAppId, + UpdateStages.WithSingleSignOnUrl, + UpdateStages.WithAadDomains { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DynatraceSingleSignOnResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DynatraceSingleSignOnResource apply(Context context); + } + /** The DynatraceSingleSignOnResource update stages. */ + interface UpdateStages { + /** The stage of the DynatraceSingleSignOnResource update allowing to specify singleSignOnState. */ + interface WithSingleSignOnState { + /** + * Specifies the singleSignOnState property: State of Single Sign On. + * + * @param singleSignOnState State of Single Sign On. + * @return the next definition stage. + */ + Update withSingleSignOnState(SingleSignOnStates singleSignOnState); + } + /** The stage of the DynatraceSingleSignOnResource update allowing to specify enterpriseAppId. */ + interface WithEnterpriseAppId { + /** + * Specifies the enterpriseAppId property: Version of the Dynatrace agent installed on the VM.. + * + * @param enterpriseAppId Version of the Dynatrace agent installed on the VM. + * @return the next definition stage. + */ + Update withEnterpriseAppId(String enterpriseAppId); + } + /** The stage of the DynatraceSingleSignOnResource update allowing to specify singleSignOnUrl. */ + interface WithSingleSignOnUrl { + /** + * Specifies the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @param singleSignOnUrl The login URL specific to this Dynatrace Environment. + * @return the next definition stage. + */ + Update withSingleSignOnUrl(String singleSignOnUrl); + } + /** The stage of the DynatraceSingleSignOnResource update allowing to specify aadDomains. */ + interface WithAadDomains { + /** + * Specifies the aadDomains property: array of Aad(azure active directory) domains. + * + * @param aadDomains array of Aad(azure active directory) domains. + * @return the next definition stage. + */ + Update withAadDomains(List aadDomains); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DynatraceSingleSignOnResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DynatraceSingleSignOnResource refresh(Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceSingleSignOnResourceListResult.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceSingleSignOnResourceListResult.java new file mode 100644 index 000000000000..053b6bfda029 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/DynatraceSingleSignOnResourceListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of a DynatraceSingleSignOnResource list operation. */ +@Fluent +public final class DynatraceSingleSignOnResourceListResult { + /* + * The items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink", required = true) + private String nextLink; + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The items on this page. + * + * @param value the value value to set. + * @return the DynatraceSingleSignOnResourceListResult object itself. + */ + public DynatraceSingleSignOnResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DynatraceSingleSignOnResourceListResult object itself. + */ + public DynatraceSingleSignOnResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model DynatraceSingleSignOnResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + if (nextLink() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nextLink in model DynatraceSingleSignOnResourceListResult")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DynatraceSingleSignOnResourceListResult.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/EnvironmentInfo.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/EnvironmentInfo.java new file mode 100644 index 000000000000..6d54e7b013ba --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/EnvironmentInfo.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dynatrace Environment Information. */ +@Fluent +public final class EnvironmentInfo { + /* + * Id of the environment created + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * Ingestion key of the environment + */ + @JsonProperty(value = "ingestionKey") + private String ingestionKey; + + /* + * Ingestion endpoint used for sending logs + */ + @JsonProperty(value = "logsIngestionEndpoint") + private String logsIngestionEndpoint; + + /* + * Landing URL for Dynatrace environment + */ + @JsonProperty(value = "landingURL") + private String landingUrl; + + /** + * Get the environmentId property: Id of the environment created. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Id of the environment created. + * + * @param environmentId the environmentId value to set. + * @return the EnvironmentInfo object itself. + */ + public EnvironmentInfo withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the ingestionKey property: Ingestion key of the environment. + * + * @return the ingestionKey value. + */ + public String ingestionKey() { + return this.ingestionKey; + } + + /** + * Set the ingestionKey property: Ingestion key of the environment. + * + * @param ingestionKey the ingestionKey value to set. + * @return the EnvironmentInfo object itself. + */ + public EnvironmentInfo withIngestionKey(String ingestionKey) { + this.ingestionKey = ingestionKey; + return this; + } + + /** + * Get the logsIngestionEndpoint property: Ingestion endpoint used for sending logs. + * + * @return the logsIngestionEndpoint value. + */ + public String logsIngestionEndpoint() { + return this.logsIngestionEndpoint; + } + + /** + * Set the logsIngestionEndpoint property: Ingestion endpoint used for sending logs. + * + * @param logsIngestionEndpoint the logsIngestionEndpoint value to set. + * @return the EnvironmentInfo object itself. + */ + public EnvironmentInfo withLogsIngestionEndpoint(String logsIngestionEndpoint) { + this.logsIngestionEndpoint = logsIngestionEndpoint; + return this; + } + + /** + * Get the landingUrl property: Landing URL for Dynatrace environment. + * + * @return the landingUrl value. + */ + public String landingUrl() { + return this.landingUrl; + } + + /** + * Set the landingUrl property: Landing URL for Dynatrace environment. + * + * @param landingUrl the landingUrl value to set. + * @return the EnvironmentInfo object itself. + */ + public EnvironmentInfo withLandingUrl(String landingUrl) { + this.landingUrl = landingUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/FilteringTag.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/FilteringTag.java new file mode 100644 index 000000000000..8cfa7024fc98 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/FilteringTag.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +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. + */ +@Fluent +public final 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; + + /* + * Valid actions for a filtering tag. Exclusion takes priority over + * inclusion. + */ + @JsonProperty(value = "action") + private TagAction action; + + /** + * Get the name property: The name (also known as the key) of the tag. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 property: The value of the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: 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 the action property: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + * + * @return the action value. + */ + public TagAction action() { + return this.action; + } + + /** + * Set the action property: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + * + * @param action the action value to set. + * @return the FilteringTag object itself. + */ + public FilteringTag withAction(TagAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/IdentityProperties.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/IdentityProperties.java new file mode 100644 index 000000000000..782052d5e982 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/IdentityProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The properties of the managed service identities assigned to this resource. */ +@Fluent +public final class IdentityProperties { + /* + * The Active Directory tenant id of the principal. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The active directory identifier of this principal. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The type of managed identity assigned to this resource. + */ + @JsonProperty(value = "type", required = true) + private ManagedIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the tenantId property: The Active Directory tenant id of the principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the principalId property: The active directory identifier of this principal. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model IdentityProperties")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IdentityProperties.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LiftrResourceCategories.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LiftrResourceCategories.java new file mode 100644 index 000000000000..2df1abb755fd --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LiftrResourceCategories.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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); + } + + /** + * Gets known LiftrResourceCategories values. + * + * @return known LiftrResourceCategories values. + */ + public static Collection values() { + return values(LiftrResourceCategories.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentListResponse.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentListResponse.java new file mode 100644 index 000000000000..72703ccb63cb --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentListResponse.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for getting all the linkable environments. */ +@Fluent +public final class LinkableEnvironmentListResponse { + /* + * List of environments for which user is an admin + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results, if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of environments for which user is an admin. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of environments for which user is an admin. + * + * @param value the value value to set. + * @return the LinkableEnvironmentListResponse object itself. + */ + public LinkableEnvironmentListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results, if any. + * + * @param nextLink the nextLink value to set. + * @return the LinkableEnvironmentListResponse object itself. + */ + public LinkableEnvironmentListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentRequest.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentRequest.java new file mode 100644 index 000000000000..ff9aba1f8cba --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentRequest.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request for getting all the linkable environments for a user. */ +@Fluent +public final class LinkableEnvironmentRequest { + /* + * Tenant Id of the user in which they want to link the environment + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * user principal id of the user + */ + @JsonProperty(value = "userPrincipal") + private String userPrincipal; + + /* + * Azure region in which we want to link the environment + */ + @JsonProperty(value = "region") + private String region; + + /** + * Get the tenantId property: Tenant Id of the user in which they want to link the environment. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id of the user in which they want to link the environment. + * + * @param tenantId the tenantId value to set. + * @return the LinkableEnvironmentRequest object itself. + */ + public LinkableEnvironmentRequest withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the userPrincipal property: user principal id of the user. + * + * @return the userPrincipal value. + */ + public String userPrincipal() { + return this.userPrincipal; + } + + /** + * Set the userPrincipal property: user principal id of the user. + * + * @param userPrincipal the userPrincipal value to set. + * @return the LinkableEnvironmentRequest object itself. + */ + public LinkableEnvironmentRequest withUserPrincipal(String userPrincipal) { + this.userPrincipal = userPrincipal; + return this; + } + + /** + * Get the region property: Azure region in which we want to link the environment. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Azure region in which we want to link the environment. + * + * @param region the region value to set. + * @return the LinkableEnvironmentRequest object itself. + */ + public LinkableEnvironmentRequest withRegion(String region) { + this.region = region; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentResponse.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentResponse.java new file mode 100644 index 000000000000..f15b2b8c1e9d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LinkableEnvironmentResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner; + +/** An immutable client-side representation of LinkableEnvironmentResponse. */ +public interface LinkableEnvironmentResponse { + /** + * Gets the environmentId property: environment id for which user is an admin. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the environmentName property: Name of the environment. + * + * @return the environmentName value. + */ + String environmentName(); + + /** + * Gets the planData property: Billing plan information. + * + * @return the planData value. + */ + PlanData planData(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.LinkableEnvironmentResponseInner object. + * + * @return the inner object. + */ + LinkableEnvironmentResponseInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LogModule.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LogModule.java new file mode 100644 index 000000000000..1c8d6637ac22 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LogModule.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogModule. */ +public final class LogModule extends ExpandableStringEnum { + /** Static value ENABLED for LogModule. */ + public static final LogModule ENABLED = fromString("ENABLED"); + + /** Static value DISABLED for LogModule. */ + public static final LogModule DISABLED = fromString("DISABLED"); + + /** + * Creates or finds a LogModule from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogModule. + */ + @JsonCreator + public static LogModule fromString(String name) { + return fromString(name, LogModule.class); + } + + /** + * Gets known LogModule values. + * + * @return known LogModule values. + */ + public static Collection values() { + return values(LogModule.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LogRules.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LogRules.java new file mode 100644 index 000000000000..6b2fcb40c768 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/LogRules.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Set of rules for sending logs for the Monitor resource. */ +@Fluent +public final class LogRules { + /* + * Flag specifying if AAD logs should be sent for the Monitor resource. + */ + @JsonProperty(value = "sendAadLogs") + private SendAadLogsStatus sendAadLogs; + + /* + * Flag specifying if subscription logs should be sent for the Monitor + * resource. + */ + @JsonProperty(value = "sendSubscriptionLogs") + private SendSubscriptionLogsStatus sendSubscriptionLogs; + + /* + * Flag specifying if activity logs from Azure resources should be sent for + * the Monitor resource. + */ + @JsonProperty(value = "sendActivityLogs") + private SendActivityLogsStatus sendActivityLogs; + + /* + * List of filtering tags to be used for capturing logs. This only takes + * effect if SendActivityLogs flag is enabled. If empty, all resources will + * be captured. + * If only Exclude action is specified, the rules will apply to the list of + * all available resources. If Include actions are specified, the rules + * will only include resources with the associated tags. + */ + @JsonProperty(value = "filteringTags") + private List filteringTags; + + /** + * Get the sendAadLogs property: Flag specifying if AAD logs should be sent for the Monitor resource. + * + * @return the sendAadLogs value. + */ + public SendAadLogsStatus sendAadLogs() { + return this.sendAadLogs; + } + + /** + * Set the sendAadLogs property: 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(SendAadLogsStatus sendAadLogs) { + this.sendAadLogs = sendAadLogs; + return this; + } + + /** + * Get the sendSubscriptionLogs property: Flag specifying if subscription logs should be sent for the Monitor + * resource. + * + * @return the sendSubscriptionLogs value. + */ + public SendSubscriptionLogsStatus sendSubscriptionLogs() { + return this.sendSubscriptionLogs; + } + + /** + * Set the sendSubscriptionLogs property: Flag specifying if subscription logs should be sent for the Monitor + * resource. + * + * @param sendSubscriptionLogs the sendSubscriptionLogs value to set. + * @return the LogRules object itself. + */ + public LogRules withSendSubscriptionLogs(SendSubscriptionLogsStatus sendSubscriptionLogs) { + this.sendSubscriptionLogs = sendSubscriptionLogs; + return this; + } + + /** + * Get the sendActivityLogs property: Flag specifying if activity logs from Azure resources should be sent for the + * Monitor resource. + * + * @return the sendActivityLogs value. + */ + public SendActivityLogsStatus sendActivityLogs() { + return this.sendActivityLogs; + } + + /** + * Set the sendActivityLogs property: Flag specifying if activity logs from Azure resources should be sent for the + * Monitor resource. + * + * @param sendActivityLogs the sendActivityLogs value to set. + * @return the LogRules object itself. + */ + public LogRules withSendActivityLogs(SendActivityLogsStatus sendActivityLogs) { + this.sendActivityLogs = sendActivityLogs; + return this; + } + + /** + * Get the filteringTags property: List of filtering tags to be used for capturing logs. This only takes effect if + * SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, + * the rules will apply to the list of all available resources. If Include actions are specified, the rules will + * only include resources with the associated tags. + * + * @return the filteringTags value. + */ + public List filteringTags() { + return this.filteringTags; + } + + /** + * Set the filteringTags property: List of filtering tags to be used for capturing logs. This only takes effect if + * SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, + * the rules will apply to the list of all available resources. If Include actions are specified, the rules will + * only include resources with the associated tags. + * + * @param filteringTags the filteringTags value to set. + * @return the LogRules object itself. + */ + public LogRules withFilteringTags(List filteringTags) { + this.filteringTags = filteringTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filteringTags() != null) { + filteringTags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ManagedIdentityType.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ManagedIdentityType.java new file mode 100644 index 000000000000..d27f4798441f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ManagedIdentityType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentityType. */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAndUserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_AND_USER_ASSIGNED = fromString("SystemAndUserAssigned"); + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** + * Gets known ManagedIdentityType values. + * + * @return known ManagedIdentityType values. + */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MarketplaceSubscriptionStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MarketplaceSubscriptionStatus.java new file mode 100644 index 000000000000..2ea378975ee7 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MarketplaceSubscriptionStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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); + } + + /** + * Gets known MarketplaceSubscriptionStatus values. + * + * @return known MarketplaceSubscriptionStatus values. + */ + public static Collection values() { + return values(MarketplaceSubscriptionStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MetricRules.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MetricRules.java new file mode 100644 index 000000000000..85b8fae32a22 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MetricRules.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Set of rules for sending metrics for the Monitor resource. */ +@Fluent +public final 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 the filteringTags property: 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 the filteringTags property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filteringTags() != null) { + filteringTags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResource.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResource.java new file mode 100644 index 000000000000..1f6400e43c59 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResource.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner; +import java.util.Map; + +/** An immutable client-side representation of MonitorResource. */ +public interface MonitorResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: System metadata for this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the monitoringStatus property: Status of the monitor. + * + * @return the monitoringStatus value. + */ + MonitoringStatus monitoringStatus(); + + /** + * Gets the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @return the marketplaceSubscriptionStatus value. + */ + MarketplaceSubscriptionStatus marketplaceSubscriptionStatus(); + + /** + * Gets the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @return the dynatraceEnvironmentProperties value. + */ + DynatraceEnvironmentProperties dynatraceEnvironmentProperties(); + + /** + * Gets the userInfo property: User info. + * + * @return the userInfo value. + */ + UserInfo userInfo(); + + /** + * Gets the planData property: Billing plan information. + * + * @return the planData value. + */ + PlanData planData(); + + /** + * Gets the liftrResourceCategory property: Liftr Resource category. + * + * @return the liftrResourceCategory value. + */ + LiftrResourceCategories liftrResourceCategory(); + + /** + * Gets the liftrResourcePreference property: The priority of the resource. + * + * @return the liftrResourcePreference value. + */ + Integer liftrResourcePreference(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner object. + * + * @return the inner object. + */ + MonitorResourceInner innerModel(); + + /** The entirety of the MonitorResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The MonitorResource definition stages. */ + interface DefinitionStages { + /** The first stage of the MonitorResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the MonitorResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the MonitorResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the MonitorResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithMonitoringStatus, + DefinitionStages.WithMarketplaceSubscriptionStatus, + DefinitionStages.WithDynatraceEnvironmentProperties, + DefinitionStages.WithUserInfo, + DefinitionStages.WithPlanData { + /** + * Executes the create request. + * + * @return the created resource. + */ + MonitorResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MonitorResource create(Context context); + } + /** The stage of the MonitorResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the MonitorResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the MonitorResource definition allowing to specify monitoringStatus. */ + interface WithMonitoringStatus { + /** + * Specifies the monitoringStatus property: Status of the monitor.. + * + * @param monitoringStatus Status of the monitor. + * @return the next definition stage. + */ + WithCreate withMonitoringStatus(MonitoringStatus monitoringStatus); + } + /** The stage of the MonitorResource definition allowing to specify marketplaceSubscriptionStatus. */ + interface WithMarketplaceSubscriptionStatus { + /** + * Specifies the marketplaceSubscriptionStatus property: Marketplace subscription status.. + * + * @param marketplaceSubscriptionStatus Marketplace subscription status. + * @return the next definition stage. + */ + WithCreate withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus marketplaceSubscriptionStatus); + } + /** The stage of the MonitorResource definition allowing to specify dynatraceEnvironmentProperties. */ + interface WithDynatraceEnvironmentProperties { + /** + * Specifies the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment.. + * + * @param dynatraceEnvironmentProperties Properties of the Dynatrace environment. + * @return the next definition stage. + */ + WithCreate withDynatraceEnvironmentProperties( + DynatraceEnvironmentProperties dynatraceEnvironmentProperties); + } + /** The stage of the MonitorResource definition allowing to specify userInfo. */ + interface WithUserInfo { + /** + * Specifies the userInfo property: User info.. + * + * @param userInfo User info. + * @return the next definition stage. + */ + WithCreate withUserInfo(UserInfo userInfo); + } + /** The stage of the MonitorResource definition allowing to specify planData. */ + interface WithPlanData { + /** + * Specifies the planData property: Billing plan information.. + * + * @param planData Billing plan information. + * @return the next definition stage. + */ + WithCreate withPlanData(PlanData planData); + } + } + /** + * Begins update for the MonitorResource resource. + * + * @return the stage of resource update. + */ + MonitorResource.Update update(); + + /** The template for MonitorResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithMonitoringStatus, + UpdateStages.WithMarketplaceSubscriptionStatus, + UpdateStages.WithDynatraceEnvironmentProperties, + UpdateStages.WithUserInfo, + UpdateStages.WithPlanData { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MonitorResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MonitorResource apply(Context context); + } + /** The MonitorResource update stages. */ + interface UpdateStages { + /** The stage of the MonitorResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the MonitorResource update allowing to specify monitoringStatus. */ + interface WithMonitoringStatus { + /** + * Specifies the monitoringStatus property: Status of the monitor.. + * + * @param monitoringStatus Status of the monitor. + * @return the next definition stage. + */ + Update withMonitoringStatus(MonitoringStatus monitoringStatus); + } + /** The stage of the MonitorResource update allowing to specify marketplaceSubscriptionStatus. */ + interface WithMarketplaceSubscriptionStatus { + /** + * Specifies the marketplaceSubscriptionStatus property: Marketplace subscription status.. + * + * @param marketplaceSubscriptionStatus Marketplace subscription status. + * @return the next definition stage. + */ + Update withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus marketplaceSubscriptionStatus); + } + /** The stage of the MonitorResource update allowing to specify dynatraceEnvironmentProperties. */ + interface WithDynatraceEnvironmentProperties { + /** + * Specifies the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment.. + * + * @param dynatraceEnvironmentProperties Properties of the Dynatrace environment. + * @return the next definition stage. + */ + Update withDynatraceEnvironmentProperties(DynatraceEnvironmentProperties dynatraceEnvironmentProperties); + } + /** The stage of the MonitorResource update allowing to specify userInfo. */ + interface WithUserInfo { + /** + * Specifies the userInfo property: User info.. + * + * @param userInfo User info. + * @return the next definition stage. + */ + Update withUserInfo(UserInfo userInfo); + } + /** The stage of the MonitorResource update allowing to specify planData. */ + interface WithPlanData { + /** + * Specifies the planData property: Billing plan information.. + * + * @param planData Billing plan information. + * @return the next definition stage. + */ + Update withPlanData(PlanData planData); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MonitorResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MonitorResource refresh(Context context); + + /** + * Gets the user account credentials for a Monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor. + */ + AccountInfoSecure getAccountCredentials(); + + /** + * Gets the user account credentials for a Monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor along with {@link Response}. + */ + Response getAccountCredentialsWithResponse(Context context); + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listMonitoredResources(); + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listMonitoredResources(Context context); + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent. + */ + VMExtensionPayload getVMHostPayload(); + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response}. + */ + Response getVMHostPayloadWithResponse(Context context); + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listHosts(); + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listHosts(Context context); + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listAppServices(); + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listAppServices(Context context); + + /** + * Gets the SSO configuration details from the partner. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner. + */ + SsoDetailsResponse getSsoDetails(); + + /** + * Gets the SSO configuration details from the partner. + * + * @param request The details of the get sso details request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner along with {@link Response}. + */ + Response getSsoDetailsWithResponse(SsoDetailsRequest request, Context context); + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param request The details of the linkable environment request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listLinkableEnvironments(LinkableEnvironmentRequest request); + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param request The details of the linkable environment request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listLinkableEnvironments( + LinkableEnvironmentRequest request, Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResourceListResult.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResourceListResult.java new file mode 100644 index 000000000000..851bbb2be1ea --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResourceListResult.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitorResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of a MonitorResource list operation. */ +@Fluent +public final class MonitorResourceListResult { + /* + * The items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink", required = true) + private String nextLink; + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The items on this page. + * + * @param value the value value to set. + * @return the MonitorResourceListResult object itself. + */ + public MonitorResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MonitorResourceListResult object itself. + */ + public MonitorResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model MonitorResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + if (nextLink() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nextLink in model MonitorResourceListResult")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorResourceListResult.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResourceUpdate.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResourceUpdate.java new file mode 100644 index 000000000000..890eb8782277 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitorResourceUpdate.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The updatable properties of the MonitorResource. */ +@Fluent +public final class MonitorResourceUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Status of the monitor. + */ + @JsonProperty(value = "monitoringStatus") + private MonitoringStatus monitoringStatus; + + /* + * Marketplace subscription status. + */ + @JsonProperty(value = "marketplaceSubscriptionStatus") + private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; + + /* + * Properties of the Dynatrace environment. + */ + @JsonProperty(value = "dynatraceEnvironmentProperties") + private DynatraceEnvironmentProperties dynatraceEnvironmentProperties; + + /* + * User info. + */ + @JsonProperty(value = "userInfo") + private UserInfo userInfo; + + /* + * Billing plan information. + */ + @JsonProperty(value = "planData") + private PlanData planData; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the MonitorResourceUpdate object itself. + */ + public MonitorResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the monitoringStatus property: Status of the monitor. + * + * @return the monitoringStatus value. + */ + public MonitoringStatus monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoringStatus property: Status of the monitor. + * + * @param monitoringStatus the monitoringStatus value to set. + * @return the MonitorResourceUpdate object itself. + */ + public MonitorResourceUpdate withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + + /** + * Get the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @return the marketplaceSubscriptionStatus value. + */ + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.marketplaceSubscriptionStatus; + } + + /** + * Set the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @param marketplaceSubscriptionStatus the marketplaceSubscriptionStatus value to set. + * @return the MonitorResourceUpdate object itself. + */ + public MonitorResourceUpdate withMarketplaceSubscriptionStatus( + MarketplaceSubscriptionStatus marketplaceSubscriptionStatus) { + this.marketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + return this; + } + + /** + * Get the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @return the dynatraceEnvironmentProperties value. + */ + public DynatraceEnvironmentProperties dynatraceEnvironmentProperties() { + return this.dynatraceEnvironmentProperties; + } + + /** + * Set the dynatraceEnvironmentProperties property: Properties of the Dynatrace environment. + * + * @param dynatraceEnvironmentProperties the dynatraceEnvironmentProperties value to set. + * @return the MonitorResourceUpdate object itself. + */ + public MonitorResourceUpdate withDynatraceEnvironmentProperties( + DynatraceEnvironmentProperties dynatraceEnvironmentProperties) { + this.dynatraceEnvironmentProperties = dynatraceEnvironmentProperties; + return this; + } + + /** + * Get the userInfo property: User info. + * + * @return the userInfo value. + */ + public UserInfo userInfo() { + return this.userInfo; + } + + /** + * Set the userInfo property: User info. + * + * @param userInfo the userInfo value to set. + * @return the MonitorResourceUpdate object itself. + */ + public MonitorResourceUpdate withUserInfo(UserInfo userInfo) { + this.userInfo = userInfo; + return this; + } + + /** + * Get the planData property: Billing plan information. + * + * @return the planData value. + */ + public PlanData planData() { + return this.planData; + } + + /** + * Set the planData property: Billing plan information. + * + * @param planData the planData value to set. + * @return the MonitorResourceUpdate object itself. + */ + public MonitorResourceUpdate withPlanData(PlanData planData) { + this.planData = planData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dynatraceEnvironmentProperties() != null) { + dynatraceEnvironmentProperties().validate(); + } + if (userInfo() != null) { + userInfo().validate(); + } + if (planData() != null) { + planData().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoredResource.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoredResource.java new file mode 100644 index 000000000000..a4eed2158792 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoredResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner; + +/** An immutable client-side representation of MonitoredResource. */ +public interface MonitoredResource { + /** + * Gets the id property: The ARM id of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the sendingMetrics property: Flag indicating if resource is sending metrics to Dynatrace. + * + * @return the sendingMetrics value. + */ + SendingMetricsStatus sendingMetrics(); + + /** + * Gets the reasonForMetricsStatus property: Reason for why the resource is sending metrics (or why it is not + * sending). + * + * @return the reasonForMetricsStatus value. + */ + String reasonForMetricsStatus(); + + /** + * Gets the sendingLogs property: Flag indicating if resource is sending logs to Dynatrace. + * + * @return the sendingLogs value. + */ + SendingLogsStatus sendingLogs(); + + /** + * Gets the reasonForLogsStatus property: Reason for why the resource is sending logs (or why it is not sending). + * + * @return the reasonForLogsStatus value. + */ + String reasonForLogsStatus(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner object. + * + * @return the inner object. + */ + MonitoredResourceInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoredResourceListResponse.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoredResourceListResponse.java new file mode 100644 index 000000000000..2f536d67d80b --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoredResourceListResponse.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.models.MonitoredResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the resources being monitored by Dynatrace monitor resource. */ +@Fluent +public final class MonitoredResourceListResponse { + /* + * The items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink", required = true) + private String nextLink; + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The items on this page. + * + * @param value the value value to set. + * @return the MonitoredResourceListResponse object itself. + */ + public MonitoredResourceListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MonitoredResourceListResponse object itself. + */ + public MonitoredResourceListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model MonitoredResourceListResponse")); + } else { + value().forEach(e -> e.validate()); + } + if (nextLink() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nextLink in model MonitoredResourceListResponse")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MonitoredResourceListResponse.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoringStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoringStatus.java new file mode 100644 index 000000000000..f2fdc1e48a3d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoringStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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); + } + + /** + * Gets known MonitoringStatus values. + * + * @return known MonitoringStatus values. + */ + public static Collection values() { + return values(MonitoringStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoringType.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoringType.java new file mode 100644 index 000000000000..d16031b325c0 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/MonitoringType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringType. */ +public final class MonitoringType extends ExpandableStringEnum { + /** Static value CLOUD_INFRASTRUCTURE for MonitoringType. */ + public static final MonitoringType CLOUD_INFRASTRUCTURE = fromString("CLOUD_INFRASTRUCTURE"); + + /** Static value FULL_STACK for MonitoringType. */ + public static final MonitoringType FULL_STACK = fromString("FULL_STACK"); + + /** + * Creates or finds a MonitoringType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringType. + */ + @JsonCreator + public static MonitoringType fromString(String name) { + return fromString(name, MonitoringType.class); + } + + /** + * Gets known MonitoringType values. + * + * @return known MonitoringType values. + */ + public static Collection values() { + return values(MonitoringType.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Monitors.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Monitors.java new file mode 100644 index 000000000000..2022910d260d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Monitors.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Monitors. */ +public interface Monitors { + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor. + */ + AccountInfoSecure getAccountCredentials(String resourceGroupName, String monitorName); + + /** + * Gets the user account credentials for a Monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user account credentials for a Monitor along with {@link Response}. + */ + Response getAccountCredentialsWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listMonitoredResources(String resourceGroupName, String monitorName); + + /** + * List the resources currently being monitored by the Dynatrace monitor resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by Dynatrace monitor resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listMonitoredResources( + String resourceGroupName, String monitorName, Context context); + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent. + */ + VMExtensionPayload getVMHostPayload(String resourceGroupName, String monitorName); + + /** + * Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a VM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of payload to be passed while installing VM agent along with {@link Response}. + */ + Response getVMHostPayloadWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource. + */ + MonitorResource getByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Get a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Delete a MonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, Context context); + + /** + * List all MonitorResource by subscriptionId. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all MonitorResource by subscriptionId. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List MonitorResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MonitorResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listHosts(String resourceGroupName, String monitorName); + + /** + * List the compute resources currently being monitored by the Dynatrace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listHosts(String resourceGroupName, String monitorName, Context context); + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listAppServices(String resourceGroupName, String monitorName); + + /** + * Gets list of App Services with Dynatrace PaaS OneAgent enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of App Services with Dynatrace PaaS OneAgent enabled as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listAppServices(String resourceGroupName, String monitorName, Context context); + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner. + */ + SsoDetailsResponse getSsoDetails(String resourceGroupName, String monitorName); + + /** + * Gets the SSO configuration details from the partner. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the get sso details request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SSO configuration details from the partner along with {@link Response}. + */ + Response getSsoDetailsWithResponse( + String resourceGroupName, String monitorName, SsoDetailsRequest request, Context context); + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request); + + /** + * Gets all the Dynatrace environments that a user can link a azure resource to. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param request The details of the linkable environment request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Dynatrace environments that a user can link a azure resource to as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listLinkableEnvironments( + String resourceGroupName, String monitorName, LinkableEnvironmentRequest request, Context context); + + /** + * Get a MonitorResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response}. + */ + MonitorResource getById(String id); + + /** + * Get a MonitorResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MonitorResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a MonitorResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a MonitorResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MonitorResource resource. + * + * @param name resource name. + * @return the first stage of the new MonitorResource definition. + */ + MonitorResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Operation.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Operation.java new file mode 100644 index 000000000000..ce9363dfb288 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/OperationDisplay.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/OperationDisplay.java new file mode 100644 index 000000000000..7a7dd69d1b3f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/OperationDisplay.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/OperationListResult.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/OperationListResult.java new file mode 100644 index 000000000000..773fff1e08d6 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/OperationListResult.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.dynatrace.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Operations.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Operations.java new file mode 100644 index 000000000000..a16aa6b1379b --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * List the operations for Dynatrace.Observability. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for Dynatrace.Observability. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Origin.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Origin.java new file mode 100644 index 000000000000..063d875fb11f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/Origin.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/PlanData.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/PlanData.java new file mode 100644 index 000000000000..eb57bcf05a8f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/PlanData.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Billing plan information. */ +@Fluent +public final class PlanData { + /* + * different usage type like PAYG/COMMITTED. this could be enum + */ + @JsonProperty(value = "usageType") + private String usageType; + + /* + * different billing cycles like MONTHLY/WEEKLY. this could be enum + */ + @JsonProperty(value = "billingCycle") + private String billingCycle; + + /* + * plan id as published by Dynatrace + */ + @JsonProperty(value = "planDetails") + private String planDetails; + + /* + * date when plan was applied + */ + @JsonProperty(value = "effectiveDate") + private OffsetDateTime effectiveDate; + + /** + * Get the usageType property: different usage type like PAYG/COMMITTED. this could be enum. + * + * @return the usageType value. + */ + public String usageType() { + return this.usageType; + } + + /** + * Set the usageType property: different usage type like PAYG/COMMITTED. this could be enum. + * + * @param usageType the usageType value to set. + * @return the PlanData object itself. + */ + public PlanData withUsageType(String usageType) { + this.usageType = usageType; + return this; + } + + /** + * Get the billingCycle property: different billing cycles like MONTHLY/WEEKLY. this could be enum. + * + * @return the billingCycle value. + */ + public String billingCycle() { + return this.billingCycle; + } + + /** + * Set the billingCycle property: different billing cycles like MONTHLY/WEEKLY. this could be enum. + * + * @param billingCycle the billingCycle value to set. + * @return the PlanData object itself. + */ + public PlanData withBillingCycle(String billingCycle) { + this.billingCycle = billingCycle; + return this; + } + + /** + * Get the planDetails property: plan id as published by Dynatrace. + * + * @return the planDetails value. + */ + public String planDetails() { + return this.planDetails; + } + + /** + * Set the planDetails property: plan id as published by Dynatrace. + * + * @param planDetails the planDetails value to set. + * @return the PlanData object itself. + */ + public PlanData withPlanDetails(String planDetails) { + this.planDetails = planDetails; + return this; + } + + /** + * Get the effectiveDate property: date when plan was applied. + * + * @return the effectiveDate value. + */ + public OffsetDateTime effectiveDate() { + return this.effectiveDate; + } + + /** + * Set the effectiveDate property: date when plan was applied. + * + * @param effectiveDate the effectiveDate value to set. + * @return the PlanData object itself. + */ + public PlanData withEffectiveDate(OffsetDateTime effectiveDate) { + this.effectiveDate = effectiveDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ProvisioningState.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ProvisioningState.java new file mode 100644 index 000000000000..bb5fe61ce66d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/ProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendAadLogsStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendAadLogsStatus.java new file mode 100644 index 000000000000..a76d3def770d --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendAadLogsStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SendAadLogsStatus. */ +public final class SendAadLogsStatus extends ExpandableStringEnum { + /** Static value Enabled for SendAadLogsStatus. */ + public static final SendAadLogsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SendAadLogsStatus. */ + public static final SendAadLogsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SendAadLogsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SendAadLogsStatus. + */ + @JsonCreator + public static SendAadLogsStatus fromString(String name) { + return fromString(name, SendAadLogsStatus.class); + } + + /** + * Gets known SendAadLogsStatus values. + * + * @return known SendAadLogsStatus values. + */ + public static Collection values() { + return values(SendAadLogsStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendActivityLogsStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendActivityLogsStatus.java new file mode 100644 index 000000000000..11bc07127eea --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendActivityLogsStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SendActivityLogsStatus. */ +public final class SendActivityLogsStatus extends ExpandableStringEnum { + /** Static value Enabled for SendActivityLogsStatus. */ + public static final SendActivityLogsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SendActivityLogsStatus. */ + public static final SendActivityLogsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SendActivityLogsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SendActivityLogsStatus. + */ + @JsonCreator + public static SendActivityLogsStatus fromString(String name) { + return fromString(name, SendActivityLogsStatus.class); + } + + /** + * Gets known SendActivityLogsStatus values. + * + * @return known SendActivityLogsStatus values. + */ + public static Collection values() { + return values(SendActivityLogsStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendSubscriptionLogsStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendSubscriptionLogsStatus.java new file mode 100644 index 000000000000..e8a90a492e98 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendSubscriptionLogsStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SendSubscriptionLogsStatus. */ +public final class SendSubscriptionLogsStatus extends ExpandableStringEnum { + /** Static value Enabled for SendSubscriptionLogsStatus. */ + public static final SendSubscriptionLogsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SendSubscriptionLogsStatus. */ + public static final SendSubscriptionLogsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SendSubscriptionLogsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SendSubscriptionLogsStatus. + */ + @JsonCreator + public static SendSubscriptionLogsStatus fromString(String name) { + return fromString(name, SendSubscriptionLogsStatus.class); + } + + /** + * Gets known SendSubscriptionLogsStatus values. + * + * @return known SendSubscriptionLogsStatus values. + */ + public static Collection values() { + return values(SendSubscriptionLogsStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendingLogsStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendingLogsStatus.java new file mode 100644 index 000000000000..548e9049d6af --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendingLogsStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SendingLogsStatus. */ +public final class SendingLogsStatus extends ExpandableStringEnum { + /** Static value Enabled for SendingLogsStatus. */ + public static final SendingLogsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SendingLogsStatus. */ + public static final SendingLogsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SendingLogsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SendingLogsStatus. + */ + @JsonCreator + public static SendingLogsStatus fromString(String name) { + return fromString(name, SendingLogsStatus.class); + } + + /** + * Gets known SendingLogsStatus values. + * + * @return known SendingLogsStatus values. + */ + public static Collection values() { + return values(SendingLogsStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendingMetricsStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendingMetricsStatus.java new file mode 100644 index 000000000000..cc9f1f7f4922 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SendingMetricsStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SendingMetricsStatus. */ +public final class SendingMetricsStatus extends ExpandableStringEnum { + /** Static value Enabled for SendingMetricsStatus. */ + public static final SendingMetricsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SendingMetricsStatus. */ + public static final SendingMetricsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SendingMetricsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SendingMetricsStatus. + */ + @JsonCreator + public static SendingMetricsStatus fromString(String name) { + return fromString(name, SendingMetricsStatus.class); + } + + /** + * Gets known SendingMetricsStatus values. + * + * @return known SendingMetricsStatus values. + */ + public static Collection values() { + return values(SendingMetricsStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SingleSignOnStates.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SingleSignOnStates.java new file mode 100644 index 000000000000..c04c6c183cbd --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SingleSignOnStates.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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); + } + + /** + * Gets known SingleSignOnStates values. + * + * @return known SingleSignOnStates values. + */ + public static Collection values() { + return values(SingleSignOnStates.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SingleSignOns.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SingleSignOns.java new file mode 100644 index 000000000000..4c3394850558 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SingleSignOns.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SingleSignOns. */ +public interface SingleSignOns { + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource. + */ + DynatraceSingleSignOnResource get(String resourceGroupName, String monitorName, String configurationName); + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param configurationName Single Sign On Configuration Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String monitorName, String configurationName, Context context); + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List all DynatraceSingleSignOnResource by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynatraceSingleSignOnResource list operation as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName, Context context); + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response}. + */ + DynatraceSingleSignOnResource getById(String id); + + /** + * Get a DynatraceSingleSignOnResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynatraceSingleSignOnResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DynatraceSingleSignOnResource resource. + * + * @param name resource name. + * @return the first stage of the new DynatraceSingleSignOnResource definition. + */ + DynatraceSingleSignOnResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoDetailsRequest.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoDetailsRequest.java new file mode 100644 index 000000000000..afd5e556e262 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoDetailsRequest.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request for getting sso details for a user. */ +@Fluent +public final class SsoDetailsRequest { + /* + * user principal id of the user + */ + @JsonProperty(value = "userPrincipal") + private String userPrincipal; + + /** + * Get the userPrincipal property: user principal id of the user. + * + * @return the userPrincipal value. + */ + public String userPrincipal() { + return this.userPrincipal; + } + + /** + * Set the userPrincipal property: user principal id of the user. + * + * @param userPrincipal the userPrincipal value to set. + * @return the SsoDetailsRequest object itself. + */ + public SsoDetailsRequest withUserPrincipal(String userPrincipal) { + this.userPrincipal = userPrincipal; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoDetailsResponse.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoDetailsResponse.java new file mode 100644 index 000000000000..4344d78bc4f1 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoDetailsResponse.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.SsoDetailsResponseInner; +import java.util.List; + +/** An immutable client-side representation of SsoDetailsResponse. */ +public interface SsoDetailsResponse { + /** + * Gets the isSsoEnabled property: Whether the SSO is enabled for this resource or not. + * + * @return the isSsoEnabled value. + */ + SsoStatus isSsoEnabled(); + + /** + * Gets the metadataUrl property: URL for Azure AD metadata. + * + * @return the metadataUrl value. + */ + String metadataUrl(); + + /** + * Gets the singleSignOnUrl property: The login URL specific to this Dynatrace Environment. + * + * @return the singleSignOnUrl value. + */ + String singleSignOnUrl(); + + /** + * Gets the aadDomains property: array of Aad(azure active directory) domains. + * + * @return the aadDomains value. + */ + List aadDomains(); + + /** + * Gets the adminUsers property: Array of admin user emails. + * + * @return the adminUsers value. + */ + List adminUsers(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.SsoDetailsResponseInner object. + * + * @return the inner object. + */ + SsoDetailsResponseInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoStatus.java new file mode 100644 index 000000000000..8ee2ca93cecc --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/SsoStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsoStatus. */ +public final class SsoStatus extends ExpandableStringEnum { + /** Static value Enabled for SsoStatus. */ + public static final SsoStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SsoStatus. */ + public static final SsoStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SsoStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsoStatus. + */ + @JsonCreator + public static SsoStatus fromString(String name) { + return fromString(name, SsoStatus.class); + } + + /** + * Gets known SsoStatus values. + * + * @return known SsoStatus values. + */ + public static Collection values() { + return values(SsoStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagAction.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagAction.java new file mode 100644 index 000000000000..884eba3f5ba9 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagAction.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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); + } + + /** + * Gets known TagAction values. + * + * @return known TagAction values. + */ + public static Collection values() { + return values(TagAction.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRule.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRule.java new file mode 100644 index 000000000000..e97de7e972e2 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRule.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner; + +/** An immutable client-side representation of TagRule. */ +public interface TagRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: System metadata for this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @return the logRules value. + */ + LogRules logRules(); + + /** + * Gets the metricRules property: Set of rules for sending metrics for the Monitor resource. + * + * @return the metricRules value. + */ + MetricRules metricRules(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner object. + * + * @return the inner object. + */ + TagRuleInner innerModel(); + + /** The entirety of the TagRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TagRule definition stages. */ + interface DefinitionStages { + /** The first stage of the TagRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TagRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @return the next definition stage. + */ + WithCreate withExistingMonitor(String resourceGroupName, String monitorName); + } + /** + * The stage of the TagRule definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithLogRules, DefinitionStages.WithMetricRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + TagRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TagRule create(Context context); + } + /** The stage of the TagRule definition allowing to specify logRules. */ + interface WithLogRules { + /** + * Specifies the logRules property: Set of rules for sending logs for the Monitor resource.. + * + * @param logRules Set of rules for sending logs for the Monitor resource. + * @return the next definition stage. + */ + WithCreate withLogRules(LogRules logRules); + } + /** The stage of the TagRule definition allowing to specify metricRules. */ + interface WithMetricRules { + /** + * Specifies the metricRules property: Set of rules for sending metrics for the Monitor resource.. + * + * @param metricRules Set of rules for sending metrics for the Monitor resource. + * @return the next definition stage. + */ + WithCreate withMetricRules(MetricRules metricRules); + } + } + /** + * Begins update for the TagRule resource. + * + * @return the stage of resource update. + */ + TagRule.Update update(); + + /** The template for TagRule update. */ + interface Update extends UpdateStages.WithLogRules, UpdateStages.WithMetricRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TagRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TagRule apply(Context context); + } + /** The TagRule update stages. */ + interface UpdateStages { + /** The stage of the TagRule update allowing to specify logRules. */ + interface WithLogRules { + /** + * Specifies the logRules property: Set of rules for sending logs for the Monitor resource.. + * + * @param logRules Set of rules for sending logs for the Monitor resource. + * @return the next definition stage. + */ + Update withLogRules(LogRules logRules); + } + /** The stage of the TagRule update allowing to specify metricRules. */ + interface WithMetricRules { + /** + * Specifies the metricRules property: Set of rules for sending metrics for the Monitor resource.. + * + * @param metricRules Set of rules for sending metrics for the Monitor resource. + * @return the next definition stage. + */ + Update withMetricRules(MetricRules metricRules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TagRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TagRule refresh(Context context); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRuleListResult.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRuleListResult.java new file mode 100644 index 000000000000..a3c4fe8e13f9 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRuleListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.models.TagRuleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of a TagRule list operation. */ +@Fluent +public final class TagRuleListResult { + /* + * The items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink", required = true) + private String nextLink; + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The items on this page. + * + * @param value the value value to set. + * @return the TagRuleListResult object itself. + */ + public TagRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the TagRuleListResult object itself. + */ + public TagRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model TagRuleListResult")); + } else { + value().forEach(e -> e.validate()); + } + if (nextLink() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextLink in model TagRuleListResult")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TagRuleListResult.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRuleUpdate.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRuleUpdate.java new file mode 100644 index 000000000000..992daac50bda --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRuleUpdate.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The updatable properties of the TagRule. */ +@Fluent +public final class TagRuleUpdate { + /* + * Set of rules for sending logs for the Monitor resource. + */ + @JsonProperty(value = "logRules") + private LogRules logRules; + + /* + * Set of rules for sending metrics for the Monitor resource. + */ + @JsonProperty(value = "metricRules") + private MetricRules metricRules; + + /** + * Get the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @return the logRules value. + */ + public LogRules logRules() { + return this.logRules; + } + + /** + * Set the logRules property: Set of rules for sending logs for the Monitor resource. + * + * @param logRules the logRules value to set. + * @return the TagRuleUpdate object itself. + */ + public TagRuleUpdate withLogRules(LogRules logRules) { + this.logRules = logRules; + return this; + } + + /** + * Get the metricRules property: Set of rules for sending metrics for the Monitor resource. + * + * @return the metricRules value. + */ + public MetricRules metricRules() { + return this.metricRules; + } + + /** + * Set the metricRules property: Set of rules for sending metrics for the Monitor resource. + * + * @param metricRules the metricRules value to set. + * @return the TagRuleUpdate object itself. + */ + public TagRuleUpdate withMetricRules(MetricRules metricRules) { + this.metricRules = metricRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logRules() != null) { + logRules().validate(); + } + if (metricRules() != null) { + metricRules().validate(); + } + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRules.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRules.java new file mode 100644 index 000000000000..8189b0b7341f --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/TagRules.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TagRules. */ +public interface TagRules { + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule. + */ + TagRule get(String resourceGroupName, String monitorName, String ruleSetName); + + /** + * Get a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String monitorName, String ruleSetName, Context context); + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, String ruleSetName); + + /** + * Delete a TagRule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param ruleSetName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context); + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * List all TagRule by monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Monitor resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName, Context context); + + /** + * Get a TagRule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response}. + */ + TagRule getById(String id); + + /** + * Get a TagRule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a TagRule along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a TagRule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a TagRule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TagRule resource. + * + * @param name resource name. + * @return the first stage of the new TagRule definition. + */ + TagRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UpdateStatus.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UpdateStatus.java new file mode 100644 index 000000000000..e97629f754ee --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UpdateStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpdateStatus. */ +public final class UpdateStatus extends ExpandableStringEnum { + /** Static value INCOMPATIBLE for UpdateStatus. */ + public static final UpdateStatus INCOMPATIBLE = fromString("INCOMPATIBLE"); + + /** Static value OUTDATED for UpdateStatus. */ + public static final UpdateStatus OUTDATED = fromString("OUTDATED"); + + /** Static value SCHEDULED for UpdateStatus. */ + public static final UpdateStatus SCHEDULED = fromString("SCHEDULED"); + + /** Static value SUPPRESSED for UpdateStatus. */ + public static final UpdateStatus SUPPRESSED = fromString("SUPPRESSED"); + + /** Static value UNKNOWN for UpdateStatus. */ + public static final UpdateStatus UNKNOWN = fromString("UNKNOWN"); + + /** Static value UP2DATE for UpdateStatus. */ + public static final UpdateStatus UP2DATE = fromString("UP2DATE"); + + /** Static value UPDATE_IN_PROGRESS for UpdateStatus. */ + public static final UpdateStatus UPDATE_IN_PROGRESS = fromString("UPDATE_IN_PROGRESS"); + + /** Static value UPDATE_PENDING for UpdateStatus. */ + public static final UpdateStatus UPDATE_PENDING = fromString("UPDATE_PENDING"); + + /** Static value UPDATE_PROBLEM for UpdateStatus. */ + public static final UpdateStatus UPDATE_PROBLEM = fromString("UPDATE_PROBLEM"); + + /** + * Creates or finds a UpdateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateStatus. + */ + @JsonCreator + public static UpdateStatus fromString(String name) { + return fromString(name, UpdateStatus.class); + } + + /** + * Gets known UpdateStatus values. + * + * @return known UpdateStatus values. + */ + public static Collection values() { + return values(UpdateStatus.class); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UserAssignedIdentity.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..8eb79f117515 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UserAssignedIdentity.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A managed identity assigned by the user. */ +@Fluent +public class UserAssignedIdentity { + /* + * The active directory client identifier for this principal. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * The active directory identifier for this principal. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /** + * Get the clientId property: The active directory client identifier for this principal. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The active directory client identifier for this principal. + * + * @param clientId the clientId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the principalId property: The active directory identifier for this principal. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The active directory identifier for this principal. + * + * @param principalId the principalId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property clientId in model UserAssignedIdentity")); + } + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model UserAssignedIdentity")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserAssignedIdentity.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UserInfo.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UserInfo.java new file mode 100644 index 000000000000..6b4c756c28fe --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/UserInfo.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** User info. */ +@Fluent +public final class UserInfo { + /* + * First Name of the user + */ + @JsonProperty(value = "firstName") + private String firstName; + + /* + * Last Name of the user + */ + @JsonProperty(value = "lastName") + private String lastName; + + /* + * Email of the user used by Dynatrace for contacting them if needed + */ + @JsonProperty(value = "emailAddress") + private String emailAddress; + + /* + * Phone number of the user used by Dynatrace for contacting them if needed + */ + @JsonProperty(value = "phoneNumber") + private String phoneNumber; + + /* + * Country of the user + */ + @JsonProperty(value = "country") + private String country; + + /** + * Get the firstName property: First Name of the user. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First Name of the user. + * + * @param firstName the firstName value to set. + * @return the UserInfo object itself. + */ + public UserInfo withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last Name of the user. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last Name of the user. + * + * @param lastName the lastName value to set. + * @return the UserInfo object itself. + */ + public UserInfo withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the emailAddress property: Email of the user used by Dynatrace for contacting them if needed. + * + * @return the emailAddress value. + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set the emailAddress property: Email of the user used by Dynatrace 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 the phoneNumber property: Phone number of the user used by Dynatrace for contacting them if needed. + * + * @return the phoneNumber value. + */ + public String phoneNumber() { + return this.phoneNumber; + } + + /** + * Set the phoneNumber property: Phone number of the user used by Dynatrace 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; + } + + /** + * Get the country property: Country of the user. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: Country of the user. + * + * @param country the country value to set. + * @return the UserInfo object itself. + */ + public UserInfo withCountry(String country) { + this.country = country; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMExtensionPayload.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMExtensionPayload.java new file mode 100644 index 000000000000..2461cba701ce --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMExtensionPayload.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.VMExtensionPayloadInner; + +/** An immutable client-side representation of VMExtensionPayload. */ +public interface VMExtensionPayload { + /** + * Gets the ingestionKey property: Ingestion key of the environment. + * + * @return the ingestionKey value. + */ + String ingestionKey(); + + /** + * Gets the environmentId property: Id of the environment created. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.VMExtensionPayloadInner object. + * + * @return the inner object. + */ + VMExtensionPayloadInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMHostsListResponse.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMHostsListResponse.java new file mode 100644 index 000000000000..4cc7c5b763ae --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMHostsListResponse.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response of a list VM Host Operation. */ +@Fluent +public final class VMHostsListResponse { + /* + * The items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink", required = true) + private String nextLink; + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The items on this page. + * + * @param value the value value to set. + * @return the VMHostsListResponse object itself. + */ + public VMHostsListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the VMHostsListResponse object itself. + */ + public VMHostsListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VMHostsListResponse")); + } else { + value().forEach(e -> e.validate()); + } + if (nextLink() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextLink in model VMHostsListResponse")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMHostsListResponse.class); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMInfo.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMInfo.java new file mode 100644 index 000000000000..f3b9aa17ab5e --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/VMInfo.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.models; + +import com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner; + +/** An immutable client-side representation of VMInfo. */ +public interface VMInfo { + /** + * Gets the resourceId property: Azure VM resource ID. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the version property: Version of the Dynatrace agent installed on the VM. + * + * @return the version value. + */ + String version(); + + /** + * Gets the monitoringType property: The monitoring mode of OneAgent. + * + * @return the monitoringType value. + */ + MonitoringType monitoringType(); + + /** + * Gets the autoUpdateSetting property: Update settings of OneAgent. + * + * @return the autoUpdateSetting value. + */ + AutoUpdateSetting autoUpdateSetting(); + + /** + * Gets the updateStatus property: The current update status of OneAgent. + * + * @return the updateStatus value. + */ + UpdateStatus updateStatus(); + + /** + * Gets the availabilityState property: The availability state of OneAgent. + * + * @return the availabilityState value. + */ + AvailabilityState availabilityState(); + + /** + * Gets the logModule property: Tells whether log modules are enabled or not. + * + * @return the logModule value. + */ + LogModule logModule(); + + /** + * Gets the hostGroup property: The name of the host group. + * + * @return the hostGroup value. + */ + String hostGroup(); + + /** + * Gets the hostname property: The name of the host. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the inner com.azure.resourcemanager.dynatrace.fluent.models.VMInfoInner object. + * + * @return the inner object. + */ + VMInfoInner innerModel(); +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/package-info.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/package-info.java new file mode 100644 index 000000000000..79e11f4dfb67 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for DynatraceObservability. null. */ +package com.azure.resourcemanager.dynatrace.models; diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/package-info.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/package-info.java new file mode 100644 index 000000000000..115d604c2ff5 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/com/azure/resourcemanager/dynatrace/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for DynatraceObservability. null. */ +package com.azure.resourcemanager.dynatrace; diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/module-info.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/module-info.java new file mode 100644 index 000000000000..4bb8a0d61c74 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.dynatrace { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.dynatrace; + exports com.azure.resourcemanager.dynatrace.fluent; + exports com.azure.resourcemanager.dynatrace.fluent.models; + exports com.azure.resourcemanager.dynatrace.models; + + opens com.azure.resourcemanager.dynatrace.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.dynatrace.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsCreateOrUpdateSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0d706d21c956 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsCreateOrUpdateSamples.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnProperties; +import com.azure.resourcemanager.dynatrace.models.AccountInfo; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.EnvironmentInfo; +import com.azure.resourcemanager.dynatrace.models.IdentityProperties; +import com.azure.resourcemanager.dynatrace.models.ManagedIdentityType; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors CreateOrUpdate. */ +public final class MonitorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .define("myMonitor") + .withRegion("West US 2") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("Environment", "Dev")) + .withIdentity(new IdentityProperties().withType(ManagedIdentityType.SYSTEM_ASSIGNED)) + .withMonitoringStatus(MonitoringStatus.ENABLED) + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.ACTIVE) + .withDynatraceEnvironmentProperties( + new DynatraceEnvironmentProperties() + .withAccountInfo(new AccountInfo()) + .withEnvironmentInfo(new EnvironmentInfo()) + .withSingleSignOnProperties(new DynatraceSingleSignOnProperties())) + .withUserInfo( + new UserInfo() + .withFirstName("Alice") + .withLastName("Bobab") + .withEmailAddress("alice@microsoft.com") + .withPhoneNumber("123456") + .withCountry("westus2")) + .withPlanData( + new PlanData() + .withUsageType("Committed") + .withBillingCycle("Monthly") + .withPlanDetails("dynatraceapitestplan") + .withEffectiveDate(OffsetDateTime.parse("2019-08-30T15:14:33+02:00"))) + .create(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .define("myMonitor") + .withRegion("West US 2") + .withExistingResourceGroup("myResourceGroup") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsDeleteSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsDeleteSamples.java new file mode 100644 index 000000000000..6aa2e9b288e3 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsDeleteSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors Delete. */ +public final class MonitorsDeleteSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_Delete_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsDeleteMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().delete("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_Delete_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsDeleteMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().delete("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetAccountCredentialsSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetAccountCredentialsSamples.java new file mode 100644 index 000000000000..a9075dbcabad --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetAccountCredentialsSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors GetAccountCredentials. */ +public final class MonitorsGetAccountCredentialsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetAccountCredentials_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_GetAccountCredentials_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetAccountCredentialsMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getAccountCredentialsWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetAccountCredentials_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_GetAccountCredentials_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetAccountCredentialsMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getAccountCredentialsWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetByResourceGroupSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..849252deda7c --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetByResourceGroupSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors GetByResourceGroup. */ +public final class MonitorsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Get_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_Get_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_Get_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetSsoDetailsSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetSsoDetailsSamples.java new file mode 100644 index 000000000000..3dbc48c5e105 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetSsoDetailsSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.models.SsoDetailsRequest; + +/** Samples for Monitors GetSsoDetails. */ +public final class MonitorsGetSsoDetailsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetSSODetails_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_GetSSODetails_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetSSODetailsMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .getSsoDetailsWithResponse( + "myResourceGroup", + "myMonitor", + new SsoDetailsRequest().withUserPrincipal("alice@microsoft.com"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetSSODetails_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_GetSSODetails_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetSSODetailsMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .getSsoDetailsWithResponse("myResourceGroup", "myMonitor", new SsoDetailsRequest(), Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetVMHostPayloadSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetVMHostPayloadSamples.java new file mode 100644 index 000000000000..5a8093d90325 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsGetVMHostPayloadSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors GetVMHostPayload. */ +public final class MonitorsGetVMHostPayloadSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetVMHostPayload_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_GetVMHostPayload_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetVMHostPayloadMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getVMHostPayloadWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetVMHostPayload_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_GetVMHostPayload_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsGetVMHostPayloadMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().getVMHostPayloadWithResponse("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListAppServicesSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListAppServicesSamples.java new file mode 100644 index 000000000000..2d73a88b1650 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListAppServicesSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors ListAppServices. */ +public final class MonitorsListAppServicesSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListAppServices_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListAppServices_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListAppServicesMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listAppServices("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListAppServices_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListAppServices_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListAppServicesMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listAppServices("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListByResourceGroupSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListByResourceGroupSamples.java new file mode 100644 index 000000000000..028983d4c109 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListByResourceGroupSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors ListByResourceGroup. */ +public final class MonitorsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listByResourceGroup("myResourceGroup", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListHostsSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListHostsSamples.java new file mode 100644 index 000000000000..c14c8cb11259 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListHostsSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors ListHosts. */ +public final class MonitorsListHostsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListHosts_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListHosts_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListHostsMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listHosts("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListHosts_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListHosts_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListHostsMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listHosts("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListLinkableEnvironmentsSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListLinkableEnvironmentsSamples.java new file mode 100644 index 000000000000..bcca55956998 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListLinkableEnvironmentsSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.models.LinkableEnvironmentRequest; + +/** Samples for Monitors ListLinkableEnvironments. */ +public final class MonitorsListLinkableEnvironmentsSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListLinkableEnvironments_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListLinkableEnvironments_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListLinkableEnvironmentsMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .listLinkableEnvironments("myResourceGroup", "myMonitor", new LinkableEnvironmentRequest(), Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListLinkableEnvironments_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListLinkableEnvironments_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListLinkableEnvironmentsMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .monitors() + .listLinkableEnvironments( + "myResourceGroup", + "myMonitor", + new LinkableEnvironmentRequest() + .withTenantId("00000000-0000-0000-0000-000000000000") + .withUserPrincipal("alice@microsoft.com") + .withRegion("East US"), + Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListMonitoredResourcesSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListMonitoredResourcesSamples.java new file mode 100644 index 000000000000..31c5b207bd86 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListMonitoredResourcesSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors ListMonitoredResources. */ +public final class MonitorsListMonitoredResourcesSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListMonitoredResources_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListMonitoredResourcesMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listMonitoredResources("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListMonitoredResources_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListMonitoredResourcesMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().listMonitoredResources("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListSamples.java new file mode 100644 index 000000000000..89493b2f979c --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Monitors List. */ +public final class MonitorsListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListBySubscriptionId_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_ListBySubscriptionId_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListBySubscriptionIdMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListBySubscriptionId_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_ListBySubscriptionId_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsListBySubscriptionIdMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.monitors().list(Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsUpdateSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsUpdateSamples.java new file mode 100644 index 000000000000..01e350647995 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/MonitorsUpdateSamples.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.fluent.models.DynatraceSingleSignOnProperties; +import com.azure.resourcemanager.dynatrace.models.AccountInfo; +import com.azure.resourcemanager.dynatrace.models.DynatraceEnvironmentProperties; +import com.azure.resourcemanager.dynatrace.models.EnvironmentInfo; +import com.azure.resourcemanager.dynatrace.models.MarketplaceSubscriptionStatus; +import com.azure.resourcemanager.dynatrace.models.MonitorResource; +import com.azure.resourcemanager.dynatrace.models.MonitoringStatus; +import com.azure.resourcemanager.dynatrace.models.PlanData; +import com.azure.resourcemanager.dynatrace.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors Update. */ +public final class MonitorsUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Update_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_Update_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsUpdateMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + MonitorResource resource = + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE).getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_Update_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void monitorsUpdateMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + MonitorResource resource = + manager.monitors().getByResourceGroupWithResponse("myResourceGroup", "myMonitor", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("Environment", "Dev")) + .withMonitoringStatus(MonitoringStatus.ENABLED) + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.ACTIVE) + .withDynatraceEnvironmentProperties( + new DynatraceEnvironmentProperties() + .withAccountInfo(new AccountInfo()) + .withEnvironmentInfo(new EnvironmentInfo()) + .withSingleSignOnProperties(new DynatraceSingleSignOnProperties())) + .withUserInfo( + new UserInfo() + .withFirstName("Alice") + .withLastName("Bobab") + .withEmailAddress("alice@microsoft.com") + .withPhoneNumber("123456") + .withCountry("westus2")) + .withPlanData( + new PlanData() + .withUsageType("Committed") + .withBillingCycle("Monthly") + .withPlanDetails("dynatraceapitestplan") + .withEffectiveDate(OffsetDateTime.parse("2019-08-30T15:14:33+02:00"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/OperationsListSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/OperationsListSamples.java new file mode 100644 index 000000000000..e52213ca0e58 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/OperationsListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.operations().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnCreateOrUpdateSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8ce50bf0ed21 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnCreateOrUpdateSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.resourcemanager.dynatrace.models.SingleSignOnStates; +import java.util.Arrays; + +/** Samples for SingleSignOn CreateOrUpdate. */ +public final class SingleSignOnCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .singleSignOns() + .define("default") + .withExistingMonitor("myResourceGroup", "myMonitor") + .withSingleSignOnState(SingleSignOnStates.ENABLE) + .withEnterpriseAppId("00000000-0000-0000-0000-000000000000") + .withSingleSignOnUrl("https://www.dynatrace.io") + .withAadDomains(Arrays.asList("mpliftrdt20210811outlook.onmicrosoft.com")) + .create(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .singleSignOns() + .define("default") + .withExistingMonitor("myResourceGroup", "myMonitor") + .withSingleSignOnUrl("https://www.dynatrace.io") + .withAadDomains(Arrays.asList("mpliftrdt20210811outlook.onmicrosoft.com")) + .create(); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnGetSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnGetSamples.java new file mode 100644 index 000000000000..c5a8f59b3318 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnGetSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for SingleSignOn Get. */ +public final class SingleSignOnGetSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_Get_MinimumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_Get_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnGetMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_Get_MaximumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_Get_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnGetMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnListSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnListSamples.java new file mode 100644 index 000000000000..9665e838fc30 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/SingleSignOnListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for SingleSignOn List. */ +public final class SingleSignOnListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_List_MaximumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_List_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnListMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().list("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_List_MinimumSet_Gen.json + */ + /** + * Sample code: SingleSignOn_List_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void singleSignOnListMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.singleSignOns().list("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesCreateOrUpdateSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..4e2f92ea3354 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesCreateOrUpdateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.resourcemanager.dynatrace.models.FilteringTag; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.SendAadLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendActivityLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.dynatrace.models.TagAction; +import java.util.Arrays; + +/** Samples for TagRules CreateOrUpdate. */ +public final class TagRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager + .tagRules() + .define("default") + .withExistingMonitor("myResourceGroup", "myMonitor") + .withLogRules( + new LogRules() + .withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE), + new FilteringTag() + .withName("Environment") + .withValue("Dev") + .withAction(TagAction.EXCLUDE)))) + .withMetricRules( + new MetricRules() + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE)))) + .create(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().define("default").withExistingMonitor("myResourceGroup", "myMonitor").create(); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesDeleteSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesDeleteSamples.java new file mode 100644 index 000000000000..eef77fdf4a83 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesDeleteSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for TagRules Delete. */ +public final class TagRulesDeleteSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_Delete_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesDeleteMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().delete("myResourceGroup", "myMonitor", "default", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_Delete_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesDeleteMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().delete("myResourceGroup", "myMonitor", "default", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesGetSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesGetSamples.java new file mode 100644 index 000000000000..691aa415cb74 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesGetSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for TagRules Get. */ +public final class TagRulesGetSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Get_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_Get_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesGetMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Get_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_Get_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesGetMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesListSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesListSamples.java new file mode 100644 index 000000000000..a36cf1b73907 --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; + +/** Samples for TagRules List. */ +public final class TagRulesListSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_List_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_List_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesListMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().list("myResourceGroup", "myMonitor", Context.NONE); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_List_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_List_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesListMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + manager.tagRules().list("myResourceGroup", "myMonitor", Context.NONE); + } +} diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesUpdateSamples.java b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesUpdateSamples.java new file mode 100644 index 000000000000..4a10946fc6af --- /dev/null +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/src/samples/java/com/azure/resourcemanager/dynatrace/generated/TagRulesUpdateSamples.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dynatrace.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.dynatrace.models.FilteringTag; +import com.azure.resourcemanager.dynatrace.models.LogRules; +import com.azure.resourcemanager.dynatrace.models.MetricRules; +import com.azure.resourcemanager.dynatrace.models.SendAadLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendActivityLogsStatus; +import com.azure.resourcemanager.dynatrace.models.SendSubscriptionLogsStatus; +import com.azure.resourcemanager.dynatrace.models.TagAction; +import com.azure.resourcemanager.dynatrace.models.TagRule; +import java.util.Arrays; + +/** Samples for TagRules Update. */ +public final class TagRulesUpdateSamples { + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Update_MaximumSet_Gen.json + */ + /** + * Sample code: TagRules_Update_MaximumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesUpdateMaximumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + TagRule resource = + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE).getValue(); + resource + .update() + .withLogRules( + new LogRules() + .withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE), + new FilteringTag() + .withName("Environment") + .withValue("Dev") + .withAction(TagAction.EXCLUDE)))) + .withMetricRules( + new MetricRules() + .withFilteringTags( + Arrays + .asList( + new FilteringTag() + .withName("Environment") + .withValue("Prod") + .withAction(TagAction.INCLUDE)))) + .apply(); + } + + /* + * x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Update_MinimumSet_Gen.json + */ + /** + * Sample code: TagRules_Update_MinimumSet_Gen. + * + * @param manager Entry point to DynatraceManager. + */ + public static void tagRulesUpdateMinimumSetGen(com.azure.resourcemanager.dynatrace.DynatraceManager manager) { + TagRule resource = + manager.tagRules().getWithResponse("myResourceGroup", "myMonitor", "default", Context.NONE).getValue(); + resource.update().apply(); + } +} diff --git a/sdk/dynatrace/ci.yml b/sdk/dynatrace/ci.yml new file mode 100644 index 000000000000..02e8bdc6a416 --- /dev/null +++ b/sdk/dynatrace/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.yml + - sdk/dynatrace/azure-resourcemanager-dynatrace/ + exclude: + - sdk/dynatrace/pom.xml + - sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.yml + - sdk/dynatrace/azure-resourcemanager-dynatrace/ + exclude: + - sdk/dynatrace/pom.xml + - sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dynatrace + Artifacts: + - name: azure-resourcemanager-dynatrace + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdynatrace diff --git a/sdk/dynatrace/pom.xml b/sdk/dynatrace/pom.xml new file mode 100644 index 000000000000..f92a50f1bf42 --- /dev/null +++ b/sdk/dynatrace/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-dynatrace-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-dynatrace + + + +