diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 62906a566fee..464bc9b7cf1a 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -110,6 +110,7 @@ org.springframework.kafka:spring-kafka;2.5.7.RELEASE org.springframework.security:spring-security-config;5.3.5.RELEASE org.springframework.security:spring-security-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-client;5.3.5.RELEASE +org.springframework.security:spring-security-oauth2-resource-server;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-jose;5.3.5.RELEASE org.springframework.security:spring-security-web;5.3.5.RELEASE diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fa2e6238ee36..93a3782f676e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -40,17 +40,22 @@ com.azure:azure-ai-anomalydetector;3.0.0-beta.1;3.0.0-beta.2 com.azure:azure-ai-formrecognizer;3.0.3;3.1.0-beta.2 com.azure:azure-ai-metricsadvisor;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-textanalytics;5.0.1;5.1.0-beta.4 +com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-spark;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-chat;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-common;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-administration;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-sms;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-core;1.10.0;1.11.0 -com.azure:azure-core-amqp;1.6.0;1.7.0-beta.3 +com.azure:azure-core;1.11.0;1.12.0-beta.1 +com.azure:azure-core-amqp;2.0.0;2.1.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.8;1.0.0-beta.9 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.6.3;1.7.0 -com.azure:azure-core-http-okhttp;1.3.3;1.4.0 +com.azure:azure-core-http-netty;1.7.0;1.8.0-beta.1 +com.azure:azure-core-http-okhttp;1.4.0;1.5.0-beta.1 com.azure:azure-core-management;1.0.0;1.1.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 @@ -68,12 +73,12 @@ com.azure:azure-data-schemaregistry-avro;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-data-tables;12.0.0-beta.3;12.0.0-beta.4 com.azure:azure-digitaltwins-core;1.0.1;1.1.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.2.0;1.3.0-beta.1 +com.azure:azure-identity;1.2.0;1.2.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventgrid;2.0.0-beta.3;2.0.0-beta.4 com.azure:azure-messaging-eventhubs;5.3.1;5.4.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.3.1;1.4.0-beta.2 -com.azure:azure-messaging-servicebus;7.0.0-beta.7;7.0.0-beta.8 +com.azure:azure-messaging-servicebus;7.0.0;7.1.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-search-documents;11.1.2;11.2.0-beta.4 @@ -94,7 +99,7 @@ com.azure:azure-storage-blob-nio;12.0.0-beta.2;12.0.0-beta.3 com.azure:azure-storage-common;12.9.0;12.10.0-beta.1 com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.1 com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.1;12.1.0-beta.1 +com.azure:azure-storage-internal-avro;12.0.1;12.0.2-beta.1 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.7.0;12.8.0-beta.1 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 @@ -168,6 +173,7 @@ com.azure.resourcemanager:azure-resourcemanager-sql;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storage;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-hanaonazure;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 @@ -176,9 +182,7 @@ com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-b # Format; # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core;1.11.0 -unreleased_com.azure:azure-core-amqp;1.7.0-beta.3 -unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 +unreleased_com.azure:azure-messaging-servicebus;7.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -188,4 +192,3 @@ unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. beta_com.azure:azure-security-keyvault-keys;4.3.0-beta.1 -beta_com.azure:azure-core-amqp;1.7.0-beta.2 diff --git a/pom.xml b/pom.xml index d97614e5dba3..b5a8364bfada 100644 --- a/pom.xml +++ b/pom.xml @@ -9,35 +9,37 @@ 1.0.0 common/perf-test-core - eng/jacoco-test-coverage eng/code-quality-reports + eng/jacoco-test-coverage sdk/anomalydetector sdk/appconfiguration sdk/authorization sdk/batch sdk/boms - sdk/core - sdk/cosmos sdk/cognitiveservices sdk/communication + sdk/core + sdk/cosmos sdk/digitaltwins sdk/eventgrid sdk/eventhubs sdk/formrecognizer + sdk/hanaonazure sdk/identity sdk/keyvault sdk/loganalytics sdk/mediaservices - sdk/monitor sdk/metricsadvisor + sdk/monitor sdk/resourcemanager sdk/schemaregistry sdk/search sdk/servicebus + sdk/spring sdk/storage + sdk/synapse sdk/tables sdk/template sdk/textanalytics - sdk/spring diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md new file mode 100644 index 000000000000..68e5221e4305 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-09) + +- Azure Resource Manager Hana client library for Java. This package contains Microsoft Azure SDK for Hana Management SDK. HANA on Azure Client. Package tag package-2020-02-07-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md new file mode 100644 index 000000000000..762a06729af6 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md @@ -0,0 +1,84 @@ +# Azure Resource Manager Hana client library for Java + +Azure Resource Manager Hana client library for Java. + +This package contains Microsoft Azure SDK for Hana Management SDK. HANA on Azure Client. Package tag package-2020-02-07-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +```xml + + com.azure.resourcemanager + azure-resourcemanager-hanaonazure + 1.0.0-beta.1 + +``` + +### 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: + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-hanaonazure;current}) +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +HanaManager manager = HanaManager + .authenticate(credential, profile); +``` +[//]: # ({x-version-update-end}) + +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 + +## Troubleshooting + +## Next steps + +## Contributing + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft +Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +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 + + +[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/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml new file mode 100644 index 000000000000..bdaf9929e2e3 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-hanaonazure + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Hana Management + This package contains Microsoft Azure SDK for Hana Management SDK. HANA on Azure Client. Package tag package-2020-02-07-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + 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 + + + + + com.azure + azure-core-management + 1.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java new file mode 100644 index 000000000000..a6bc0c8d6885 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure; + +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.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +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.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.fluent.HanaManagementClient; +import com.azure.resourcemanager.hanaonazure.implementation.HanaManagementClientBuilder; +import com.azure.resourcemanager.hanaonazure.implementation.OperationsImpl; +import com.azure.resourcemanager.hanaonazure.implementation.ProviderInstancesImpl; +import com.azure.resourcemanager.hanaonazure.implementation.SapMonitorsImpl; +import com.azure.resourcemanager.hanaonazure.models.Operations; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstances; +import com.azure.resourcemanager.hanaonazure.models.SapMonitors; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to HanaManager. HANA on Azure Client. */ +public final class HanaManager { + private Operations operations; + + private SapMonitors sapMonitors; + + private ProviderInstances providerInstances; + + private final HanaManagementClient clientObject; + + private HanaManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new HanaManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Hana service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Hana service API instance. + */ + public static HanaManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create HanaManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HanaManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + 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; + } + + /** + * 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 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, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Hana service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Hana service API instance. + */ + public HanaManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.hanaonazure", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new HanaManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of SapMonitors. */ + public SapMonitors sapMonitors() { + if (this.sapMonitors == null) { + this.sapMonitors = new SapMonitorsImpl(clientObject.getSapMonitors(), this); + } + return sapMonitors; + } + + /** @return Resource collection API of ProviderInstances. */ + public ProviderInstances providerInstances() { + if (this.providerInstances == null) { + this.providerInstances = new ProviderInstancesImpl(clientObject.getProviderInstances(), this); + } + return providerInstances; + } + + /** + * @return Wrapped service client HanaManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public HanaManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.java new file mode 100644 index 000000000000..b21d82ddc656 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.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.hanaonazure.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for HanaManagementClient class. */ +public interface HanaManagementClient { + /** + * Gets Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the + * URI for every service call. + * + * @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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SapMonitorsClient object to access its operations. + * + * @return the SapMonitorsClient object. + */ + SapMonitorsClient getSapMonitors(); + + /** + * Gets the ProviderInstancesClient object to access its operations. + * + * @return the ProviderInstancesClient object. + */ + ProviderInstancesClient getProviderInstances(); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.java new file mode 100644 index 000000000000..d48e0114a9b8 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.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.hanaonazure.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.hanaonazure.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.java new file mode 100644 index 000000000000..597f2ffb9c77 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.models.ProviderInstanceInner; + +/** An instance of this class provides access to all the operations defined in ProviderInstancesClient. */ +public interface ProviderInstancesClient { + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapMonitorName); + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP 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 a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner get(String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 sapMonitorName, String providerInstanceName); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 sapMonitorName, String providerInstanceName, Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.java new file mode 100644 index 000000000000..50a8a36272e5 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.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.hanaonazure.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.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.Tags; + +/** An instance of this class provides access to all the operations defined in SapMonitorsClient. */ +public interface SapMonitorsClient { + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * 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 a list of SAP monitors in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * 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 a list of SAP monitors in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner getByResourceGroup(String resourceGroupName, String sapMonitorName); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP 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 properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner create(String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner create( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String sapMonitorName); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 sapMonitorName); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the resource. + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner update(String resourceGroupName, String sapMonitorName, Tags tagsParameter); + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the 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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String sapMonitorName, Tags tagsParameter, Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.java new file mode 100644 index 000000000000..90d7ab254fd9 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.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.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.models.Display; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HANA operation information. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The name of the operation being performed on this particular object. + * This name should match the action name that appears in RBAC / the event + * service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Displayed HANA operation information + */ + @JsonProperty(value = "display") + private Display display; + + /** + * Get the name property: The name of the operation being performed on this particular object. This name should + * match the action name that appears in RBAC / the event service. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: Displayed HANA operation information. + * + * @return the display value. + */ + public Display display() { + return this.display; + } + + /** + * Set the display property: Displayed HANA operation information. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(Display display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.java new file mode 100644 index 000000000000..a651ff38d07f --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.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.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A provider instance associated with a SAP monitor. */ +@JsonFlatten +@Fluent +public class ProviderInstanceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderInstanceInner.class); + + /* + * The type of provider instance. + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * A JSON string containing the properties of the provider instance. + */ + @JsonProperty(value = "properties.properties") + private String properties; + + /* + * A JSON string containing metadata of the provider instance. + */ + @JsonProperty(value = "properties.metadata") + private String metadata; + + /* + * State of provisioning of the provider instance + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private HanaProvisioningStatesEnum provisioningState; + + /** + * Get the typePropertiesType property: The type of provider instance. + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: The type of provider instance. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the properties property: A JSON string containing the properties of the provider instance. + * + * @return the properties value. + */ + public String properties() { + return this.properties; + } + + /** + * Set the properties property: A JSON string containing the properties of the provider instance. + * + * @param properties the properties value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withProperties(String properties) { + this.properties = properties; + return this; + } + + /** + * Get the metadata property: A JSON string containing metadata of the provider instance. + * + * @return the metadata value. + */ + public String metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A JSON string containing metadata of the provider instance. + * + * @param metadata the metadata value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withMetadata(String metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + public HanaProvisioningStatesEnum provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java new file mode 100644 index 000000000000..2f6cacb7a0cc --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** SAP monitor info on Azure (ARM properties and SAP monitor properties). */ +@JsonFlatten +@Fluent +public class SapMonitorInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SapMonitorInner.class); + + /* + * State of provisioning of the HanaInstance + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private HanaProvisioningStatesEnum provisioningState; + + /* + * The name of the resource group the SAP Monitor resources get deployed + * into. + */ + @JsonProperty(value = "properties.managedResourceGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String managedResourceGroupName; + + /* + * The ARM ID of the Log Analytics Workspace that is used for monitoring + */ + @JsonProperty(value = "properties.logAnalyticsWorkspaceArmId") + private String logAnalyticsWorkspaceArmId; + + /* + * The value indicating whether to send analytics to Microsoft + */ + @JsonProperty(value = "properties.enableCustomerAnalytics") + private Boolean enableCustomerAnalytics; + + /* + * The workspace ID of the log analytics workspace to be used for + * monitoring + */ + @JsonProperty(value = "properties.logAnalyticsWorkspaceId") + private String logAnalyticsWorkspaceId; + + /* + * The shared key of the log analytics workspace that is used for + * monitoring + */ + @JsonProperty(value = "properties.logAnalyticsWorkspaceSharedKey") + private String logAnalyticsWorkspaceSharedKey; + + /* + * The version of the payload running in the Collector VM + */ + @JsonProperty(value = "properties.sapMonitorCollectorVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sapMonitorCollectorVersion; + + /* + * The subnet which the SAP monitor will be deployed in + */ + @JsonProperty(value = "properties.monitorSubnet") + private String monitorSubnet; + + /** + * Get the provisioningState property: State of provisioning of the HanaInstance. + * + * @return the provisioningState value. + */ + public HanaProvisioningStatesEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the managedResourceGroupName property: The name of the resource group the SAP Monitor resources get deployed + * into. + * + * @return the managedResourceGroupName value. + */ + public String managedResourceGroupName() { + return this.managedResourceGroupName; + } + + /** + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + public String logAnalyticsWorkspaceArmId() { + return this.logAnalyticsWorkspaceArmId; + } + + /** + * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + this.logAnalyticsWorkspaceArmId = logAnalyticsWorkspaceArmId; + return this; + } + + /** + * Get the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @return the enableCustomerAnalytics value. + */ + public Boolean enableCustomerAnalytics() { + return this.enableCustomerAnalytics; + } + + /** + * Set the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @param enableCustomerAnalytics the enableCustomerAnalytics value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withEnableCustomerAnalytics(Boolean enableCustomerAnalytics) { + this.enableCustomerAnalytics = enableCustomerAnalytics; + return this; + } + + /** + * Get the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @return the logAnalyticsWorkspaceId value. + */ + public String logAnalyticsWorkspaceId() { + return this.logAnalyticsWorkspaceId; + } + + /** + * Set the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @param logAnalyticsWorkspaceId the logAnalyticsWorkspaceId value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId) { + this.logAnalyticsWorkspaceId = logAnalyticsWorkspaceId; + return this; + } + + /** + * Get the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceSharedKey value. + */ + public String logAnalyticsWorkspaceSharedKey() { + return this.logAnalyticsWorkspaceSharedKey; + } + + /** + * Set the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @param logAnalyticsWorkspaceSharedKey the logAnalyticsWorkspaceSharedKey value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey) { + this.logAnalyticsWorkspaceSharedKey = logAnalyticsWorkspaceSharedKey; + return this; + } + + /** + * Get the sapMonitorCollectorVersion property: The version of the payload running in the Collector VM. + * + * @return the sapMonitorCollectorVersion value. + */ + public String sapMonitorCollectorVersion() { + return this.sapMonitorCollectorVersion; + } + + /** + * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + public String monitorSubnet() { + return this.monitorSubnet; + } + + /** + * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet the monitorSubnet value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withMonitorSubnet(String monitorSubnet) { + this.monitorSubnet = monitorSubnet; + return this; + } + + /** {@inheritDoc} */ + @Override + public SapMonitorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapMonitorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/package-info.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/package-info.java new file mode 100644 index 000000000000..98bcddb71ca5 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/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 HanaManagementClient. HANA on Azure Client. */ +package com.azure.resourcemanager.hanaonazure.fluent.models; diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/package-info.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/package-info.java new file mode 100644 index 000000000000..bdcdafee61cc --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/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 HanaManagementClient. HANA on Azure Client. */ +package com.azure.resourcemanager.hanaonazure.fluent; diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientBuilder.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientBuilder.java new file mode 100644 index 000000000000..b516ab874179 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientBuilder.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.CookiePolicy; +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 HanaManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {HanaManagementClientImpl.class}) +public final class HanaManagementClientBuilder { + /* + * Subscription ID which uniquely identify Microsoft Azure subscription. + * The subscription ID forms part of the URI for every service call. + */ + private String subscriptionId; + + /** + * Sets Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the + * URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the HanaManagementClientBuilder. + */ + public HanaManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the HanaManagementClientBuilder. + */ + public HanaManagementClientBuilder 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 HanaManagementClientBuilder. + */ + public HanaManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 HanaManagementClientBuilder. + */ + public HanaManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 HanaManagementClientBuilder. + */ + public HanaManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 HanaManagementClientBuilder. + */ + public HanaManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HanaManagementClientImpl with the provided parameters. + * + * @return an instance of HanaManagementClientImpl. + */ + public HanaManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + HanaManagementClientImpl client = + new HanaManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java new file mode 100644 index 000000000000..618d8ed05678 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.HanaManagementClient; +import com.azure.resourcemanager.hanaonazure.fluent.OperationsClient; +import com.azure.resourcemanager.hanaonazure.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.hanaonazure.fluent.SapMonitorsClient; +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 HanaManagementClientImpl type. */ +@ServiceClient(builder = HanaManagementClientBuilder.class) +public final class HanaManagementClientImpl implements HanaManagementClient { + private final ClientLogger logger = new ClientLogger(HanaManagementClientImpl.class); + + /** + * Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI + * for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the + * URI for every service call. + * + * @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 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 SapMonitorsClient object to access its operations. */ + private final SapMonitorsClient sapMonitors; + + /** + * Gets the SapMonitorsClient object to access its operations. + * + * @return the SapMonitorsClient object. + */ + public SapMonitorsClient getSapMonitors() { + return this.sapMonitors; + } + + /** The ProviderInstancesClient object to access its operations. */ + private final ProviderInstancesClient providerInstances; + + /** + * Gets the ProviderInstancesClient object to access its operations. + * + * @return the ProviderInstancesClient object. + */ + public ProviderInstancesClient getProviderInstances() { + return this.providerInstances; + } + + /** + * Initializes an instance of HanaManagementClient 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 Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * @param endpoint server parameter. + */ + HanaManagementClientImpl( + 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 = "2020-02-07-preview"; + this.operations = new OperationsClientImpl(this); + this.sapMonitors = new SapMonitorsClientImpl(this); + this.providerInstances = new ProviderInstancesClientImpl(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 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.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)); + } + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationImpl.java new file mode 100644 index 000000000000..bfc4812c67d8 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.implementation; + +import com.azure.resourcemanager.hanaonazure.HanaManager; +import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; +import com.azure.resourcemanager.hanaonazure.models.Display; +import com.azure.resourcemanager.hanaonazure.models.Operation; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final HanaManager serviceManager; + + public OperationImpl(OperationInner innerObject, HanaManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Display display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private HanaManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..336dc8fa3543 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.fluent.OperationsClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; +import com.azure.resourcemanager.hanaonazure.models.OperationList; +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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final HanaManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HanaManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HanaManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HanaManagementClient") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.HanaOnAzure/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @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(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @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(), null, null)); + } + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.java new file mode 100644 index 000000000000..162276592386 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.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.hanaonazure.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.hanaonazure.HanaManager; +import com.azure.resourcemanager.hanaonazure.fluent.OperationsClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; +import com.azure.resourcemanager.hanaonazure.models.Operation; +import com.azure.resourcemanager.hanaonazure.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final HanaManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, HanaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private HanaManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.java new file mode 100644 index 000000000000..533b2d10eb83 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.HanaManager; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstance; + +public final class ProviderInstanceImpl implements ProviderInstance, ProviderInstance.Definition { + private ProviderInstanceInner innerObject; + + private final HanaManager serviceManager; + + public ProviderInstanceImpl(ProviderInstanceInner innerObject, HanaManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String properties() { + return this.innerModel().properties(); + } + + public String metadata() { + return this.innerModel().metadata(); + } + + public HanaProvisioningStatesEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public ProviderInstanceInner innerModel() { + return this.innerObject; + } + + private HanaManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapMonitorName; + + private String providerInstanceName; + + public ProviderInstanceImpl withExistingSapMonitor(String resourceGroupName, String sapMonitorName) { + this.resourceGroupName = resourceGroupName; + this.sapMonitorName = sapMonitorName; + return this; + } + + public ProviderInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .create(resourceGroupName, sapMonitorName, providerInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public ProviderInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .create(resourceGroupName, sapMonitorName, providerInstanceName, this.innerModel(), context); + return this; + } + + public ProviderInstanceImpl(String name, HanaManager serviceManager) { + this.innerObject = new ProviderInstanceInner(); + this.serviceManager = serviceManager; + this.providerInstanceName = name; + } + + public ProviderInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, Context.NONE) + .getValue(); + return this; + } + + public ProviderInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, context) + .getValue(); + return this; + } + + public ProviderInstanceImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public ProviderInstanceImpl withProperties(String properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ProviderInstanceImpl withMetadata(String metadata) { + this.innerModel().withMetadata(metadata); + return this; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java new file mode 100644 index 000000000000..efbdd2fd6a82 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hanaonazure.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstanceListResult; +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 ProviderInstancesClient. */ +public final class ProviderInstancesClientImpl implements ProviderInstancesClient { + private final ClientLogger logger = new ClientLogger(ProviderInstancesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProviderInstancesService service; + + /** The service client containing this operation class. */ + private final HanaManagementClientImpl client; + + /** + * Initializes an instance of ProviderInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProviderInstancesClientImpl(HanaManagementClientImpl client) { + this.service = + RestProxy.create(ProviderInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HanaManagementClientProviderInstances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HanaManagementClient") + private interface ProviderInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances") + @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("sapMonitorName") String sapMonitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}") + @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("sapMonitorName") String sapMonitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @BodyParam("application/json") ProviderInstanceInner providerInstanceParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}") + @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("sapMonitorName") String sapMonitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @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); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapMonitorName) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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, + sapMonitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapMonitorName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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, + sapMonitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String sapMonitorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapMonitorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapMonitorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapMonitorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapMonitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapMonitorName)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapMonitorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapMonitorName, context)); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName 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, + sapMonitorName, + providerInstanceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName 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, + sapMonitorName, + providerInstanceName, + accept, + context); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return getWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner get(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return getAsync(resourceGroupName, sapMonitorName, providerInstanceName).block(); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName, context).block(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + if (providerInstanceParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter providerInstanceParameter is required and cannot be null.")); + } else { + providerInstanceParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + providerInstanceParameter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + if (providerInstanceParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter providerInstanceParameter is required and cannot be null.")); + } else { + providerInstanceParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + providerInstanceParameter, + accept, + context); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProviderInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProviderInstanceInner.class, + ProviderInstanceInner.class, + Context.NONE); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ProviderInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProviderInstanceInner.class, ProviderInstanceInner.class, context); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter) + .getSyncPoller(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return beginCreateAsync( + resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context) + .getSyncPoller(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return beginCreateAsync( + resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return createAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter).block(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter A provider instance associated with a SAP monitor. + * @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 provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return createAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context) + .block(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName 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, + sapMonitorName, + providerInstanceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName 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, + sapMonitorName, + providerInstanceName, + accept, + context); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName).getSyncPoller(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName, context).getSyncPoller(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 sapMonitorName, String providerInstanceName) { + deleteAsync(resourceGroupName, sapMonitorName, providerInstanceName).block(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 sapMonitorName, String providerInstanceName, Context context) { + deleteAsync(resourceGroupName, sapMonitorName, providerInstanceName, context).block(); + } + + /** + * 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 from the List provider instances operation. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 from the List provider instances operation. + */ + @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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.java new file mode 100644 index 000000000000..1034dc742572 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.HanaManager; +import com.azure.resourcemanager.hanaonazure.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstance; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstances; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProviderInstancesImpl implements ProviderInstances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderInstancesImpl.class); + + private final ProviderInstancesClient innerClient; + + private final HanaManager serviceManager; + + public ProviderInstancesImpl(ProviderInstancesClient innerClient, HanaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String sapMonitorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, sapMonitorName); + return inner.mapPage(inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String sapMonitorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapMonitorName, context); + return inner.mapPage(inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + } + + public ProviderInstance get(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + ProviderInstanceInner inner = this.serviceClient().get(resourceGroupName, sapMonitorName, providerInstanceName); + if (inner != null) { + return new ProviderInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + this.serviceClient().delete(resourceGroupName, sapMonitorName, providerInstanceName); + } + + public void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sapMonitorName, providerInstanceName, context); + } + + public ProviderInstance 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, providerInstanceName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, providerInstanceName, context); + } + + private ProviderInstancesClient serviceClient() { + return this.innerClient; + } + + private HanaManager manager() { + return this.serviceManager; + } + + public ProviderInstanceImpl define(String name) { + return new ProviderInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.java new file mode 100644 index 000000000000..409ae0b9c1a5 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.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.hanaonazure.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.HanaManager; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.azure.resourcemanager.hanaonazure.models.SapMonitor; +import com.azure.resourcemanager.hanaonazure.models.Tags; +import java.util.Collections; +import java.util.Map; + +public final class SapMonitorImpl implements SapMonitor, SapMonitor.Definition, SapMonitor.Update { + private SapMonitorInner innerObject; + + private final HanaManager 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 HanaProvisioningStatesEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public String managedResourceGroupName() { + return this.innerModel().managedResourceGroupName(); + } + + public String logAnalyticsWorkspaceArmId() { + return this.innerModel().logAnalyticsWorkspaceArmId(); + } + + public Boolean enableCustomerAnalytics() { + return this.innerModel().enableCustomerAnalytics(); + } + + public String logAnalyticsWorkspaceId() { + return this.innerModel().logAnalyticsWorkspaceId(); + } + + public String logAnalyticsWorkspaceSharedKey() { + return this.innerModel().logAnalyticsWorkspaceSharedKey(); + } + + public String sapMonitorCollectorVersion() { + return this.innerModel().sapMonitorCollectorVersion(); + } + + public String monitorSubnet() { + return this.innerModel().monitorSubnet(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SapMonitorInner innerModel() { + return this.innerObject; + } + + private HanaManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapMonitorName; + + private Tags updateTagsParameter; + + public SapMonitorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SapMonitor create() { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .create(resourceGroupName, sapMonitorName, this.innerModel(), Context.NONE); + return this; + } + + public SapMonitor create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .create(resourceGroupName, sapMonitorName, this.innerModel(), context); + return this; + } + + public SapMonitorImpl(String name, HanaManager serviceManager) { + this.innerObject = new SapMonitorInner(); + this.serviceManager = serviceManager; + this.sapMonitorName = name; + } + + public SapMonitorImpl update() { + this.updateTagsParameter = new Tags(); + return this; + } + + public SapMonitor apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .updateWithResponse(resourceGroupName, sapMonitorName, updateTagsParameter, Context.NONE) + .getValue(); + return this; + } + + public SapMonitor apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .updateWithResponse(resourceGroupName, sapMonitorName, updateTagsParameter, context) + .getValue(); + return this; + } + + public SapMonitorImpl(SapMonitorInner innerObject, HanaManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapMonitorName = Utils.getValueFromIdByName(innerObject.id(), "sapMonitors"); + } + + public SapMonitor refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, Context.NONE) + .getValue(); + return this; + } + + public SapMonitor refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, context) + .getValue(); + return this; + } + + public SapMonitorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapMonitorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapMonitorImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTagsParameter.withTags(tags); + return this; + } + } + + public SapMonitorImpl withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + this.innerModel().withLogAnalyticsWorkspaceArmId(logAnalyticsWorkspaceArmId); + return this; + } + + public SapMonitorImpl withEnableCustomerAnalytics(Boolean enableCustomerAnalytics) { + this.innerModel().withEnableCustomerAnalytics(enableCustomerAnalytics); + return this; + } + + public SapMonitorImpl withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId) { + this.innerModel().withLogAnalyticsWorkspaceId(logAnalyticsWorkspaceId); + return this; + } + + public SapMonitorImpl withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey) { + this.innerModel().withLogAnalyticsWorkspaceSharedKey(logAnalyticsWorkspaceSharedKey); + return this; + } + + public SapMonitorImpl withMonitorSubnet(String monitorSubnet) { + this.innerModel().withMonitorSubnet(monitorSubnet); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java new file mode 100644 index 000000000000..17d3faf07830 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java @@ -0,0 +1,1180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hanaonazure.fluent.SapMonitorsClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.SapMonitorListResult; +import com.azure.resourcemanager.hanaonazure.models.Tags; +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 SapMonitorsClient. */ +public final class SapMonitorsClientImpl implements SapMonitorsClient { + private final ClientLogger logger = new ClientLogger(SapMonitorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SapMonitorsService service; + + /** The service client containing this operation class. */ + private final HanaManagementClientImpl client; + + /** + * Initializes an instance of SapMonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapMonitorsClientImpl(HanaManagementClientImpl client) { + this.service = + RestProxy.create(SapMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HanaManagementClientSapMonitors to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HanaManagementClient") + private interface SapMonitorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors") + @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/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @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("sapMonitorName") String sapMonitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @BodyParam("application/json") SapMonitorInner sapMonitorParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @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("sapMonitorName") String sapMonitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @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("sapMonitorName") String sapMonitorName, + @BodyParam("application/json") Tags tagsParameter, + @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); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @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 SAP monitors in the specified subscription. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @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 SAP monitors in the specified subscription. + */ + @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)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @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 SAP monitors in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @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 SAP monitors in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @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 SAP monitors in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @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 SAP monitors in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sapMonitorName) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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, + sapMonitorName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sapMonitorName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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, + sapMonitorName, + accept, + context); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sapMonitorName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapMonitorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner getByResourceGroup(String resourceGroupName, String sapMonitorName) { + return getByResourceGroupAsync(resourceGroupName, sapMonitorName).block(); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapMonitorName, context).block(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (sapMonitorParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter sapMonitorParameter is required and cannot be null.")); + } else { + sapMonitorParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + sapMonitorParameter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (sapMonitorParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter sapMonitorParameter is required and cannot be null.")); + } else { + sapMonitorParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + sapMonitorParameter, + accept, + context); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SapMonitorInner> beginCreateAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapMonitorName, sapMonitorParameter); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SapMonitorInner.class, SapMonitorInner.class, Context.NONE); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SapMonitorInner> beginCreateAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SapMonitorInner.class, SapMonitorInner.class, context); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter).getSyncPoller(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context).getSyncPoller(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner create( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + return createAsync(resourceGroupName, sapMonitorName, sapMonitorParameter).block(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter SAP monitor info on Azure (ARM properties and SAP monitor properties). + * @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 sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner create( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + return createAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context).block(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String sapMonitorName) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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, + sapMonitorName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapMonitorName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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, + sapMonitorName, + accept, + context); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sapMonitorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapMonitorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapMonitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapMonitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sapMonitorName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName).getSyncPoller(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, context).getSyncPoller(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapMonitorName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapMonitorName) { + deleteAsync(resourceGroupName, sapMonitorName).block(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapMonitorName, Context context) { + deleteAsync(resourceGroupName, sapMonitorName, context).block(); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sapMonitorName, Tags tagsParameter) { + 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (tagsParameter == null) { + return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); + } else { + tagsParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + tagsParameter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sapMonitorName, Tags tagsParameter, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (tagsParameter == null) { + return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); + } else { + tagsParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + tagsParameter, + accept, + context); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sapMonitorName, Tags tagsParameter) { + return updateWithResponseAsync(resourceGroupName, sapMonitorName, tagsParameter) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner update(String resourceGroupName, String sapMonitorName, Tags tagsParameter) { + return updateAsync(resourceGroupName, sapMonitorName, tagsParameter).block(); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Tags field of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String sapMonitorName, Tags tagsParameter, Context context) { + return updateWithResponseAsync(resourceGroupName, sapMonitorName, tagsParameter, context).block(); + } + + /** + * 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 from the List SAP monitors operation. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 from the List SAP monitors operation. + */ + @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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.java new file mode 100644 index 000000000000..d54f304ce5fb --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.HanaManager; +import com.azure.resourcemanager.hanaonazure.fluent.SapMonitorsClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.SapMonitor; +import com.azure.resourcemanager.hanaonazure.models.SapMonitors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SapMonitorsImpl implements SapMonitors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SapMonitorsImpl.class); + + private final SapMonitorsClient innerClient; + + private final HanaManager serviceManager; + + public SapMonitorsImpl(SapMonitorsClient innerClient, HanaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new SapMonitorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new SapMonitorImpl(inner1, this.manager())); + } + + public SapMonitor getByResourceGroup(String resourceGroupName, String sapMonitorName) { + SapMonitorInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, sapMonitorName); + if (inner != null) { + return new SapMonitorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapMonitorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sapMonitorName) { + this.serviceClient().delete(resourceGroupName, sapMonitorName); + } + + public void delete(String resourceGroupName, String sapMonitorName, Context context) { + this.serviceClient().delete(resourceGroupName, sapMonitorName, context); + } + + public SapMonitor 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, context); + } + + private SapMonitorsClient serviceClient() { + return this.innerClient; + } + + private HanaManager manager() { + return this.serviceManager; + } + + public SapMonitorImpl define(String name) { + return new SapMonitorImpl(name, this.manager()); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/Utils.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/Utils.java new file mode 100644 index 000000000000..60f2c23cdae0 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/Utils.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.hanaonazure.implementation; + +import java.util.Arrays; +import java.util.Iterator; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/package-info.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/package-info.java new file mode 100644 index 000000000000..3b4e74266782 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/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 HanaManagementClient. HANA on Azure Client. */ +package com.azure.resourcemanager.hanaonazure.implementation; diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java new file mode 100644 index 000000000000..3de8f83a0694 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Detailed HANA operation information. */ +@Immutable +public final class Display { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class); + + /* + * The localized friendly form of the resource provider name. This form is + * also expected to include the publisher/company responsible. Use Title + * Casing. Begin with "Microsoft" for 1st party services. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly form of the resource type related to this + * action/operation. This form should match the public documentation for + * the resource provider. Use Title Casing. For examples, refer to the + * “name” section. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The localized friendly name for the operation as shown to the user. This + * name should be concise (to fit in drop downs), but clear + * (self-documenting). Use Title Casing and include the entity/resource to + * which it applies. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The localized friendly description for the operation as shown to the + * user. This description should be thorough, yet concise. It will be used + * in tool-tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is + * 'user,system' + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * Get the provider property: The localized friendly form of the resource provider name. This form is also expected + * to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly form of the resource type related to this action/operation. + * This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer + * to the “name” section. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The localized friendly name for the operation as shown to the user. This name should + * be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource + * to which it applies. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The localized friendly description for the operation as shown to the user. This + * description should be thorough, yet concise. It will be used in tool-tips and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the origin property: The intended executor of the operation; governs the display of the operation in the RBAC + * UX and the audit logs UX. Default value is 'user,system'. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaProvisioningStatesEnum.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaProvisioningStatesEnum.java new file mode 100644 index 000000000000..dc1986765723 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaProvisioningStatesEnum.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HanaProvisioningStatesEnum. */ +public final class HanaProvisioningStatesEnum extends ExpandableStringEnum { + /** Static value Accepted for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum ACCEPTED = fromString("Accepted"); + + /** Static value Creating for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum CREATING = fromString("Creating"); + + /** Static value Updating for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum UPDATING = fromString("Updating"); + + /** Static value Failed for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum FAILED = fromString("Failed"); + + /** Static value Succeeded for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum DELETING = fromString("Deleting"); + + /** Static value Migrating for HanaProvisioningStatesEnum. */ + public static final HanaProvisioningStatesEnum MIGRATING = fromString("Migrating"); + + /** + * Creates or finds a HanaProvisioningStatesEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding HanaProvisioningStatesEnum. + */ + @JsonCreator + public static HanaProvisioningStatesEnum fromString(String name) { + return fromString(name, HanaProvisioningStatesEnum.class); + } + + /** @return known HanaProvisioningStatesEnum values. */ + public static Collection values() { + return values(HanaProvisioningStatesEnum.class); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operation.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operation.java new file mode 100644 index 000000000000..82cf24c09c6a --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operation.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation being performed on this particular object. This name should + * match the action name that appears in RBAC / the event service. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Displayed HANA operation information. + * + * @return the display value. + */ + Display display(); + + /** + * Gets the inner com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java new file mode 100644 index 000000000000..9b025ee38836 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of HANA operations. */ +@Fluent +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * List of HANA operations + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of HANA operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of HANA operations. + * + * @param value the value value to set. + * @return the OperationList object itself. + */ + public OperationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.java new file mode 100644 index 000000000000..d87915b98829 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.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.hanaonazure.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + PagedIterable list(); + + /** + * Gets a list of SAP HANA management operations. + * + * @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 SAP HANA management operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.java new file mode 100644 index 000000000000..e2006e3941d7 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; + +/** An immutable client-side representation of ProviderInstance. */ +public interface ProviderInstance { + /** + * 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 typePropertiesType property: The type of provider instance. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the properties property: A JSON string containing the properties of the provider instance. + * + * @return the properties value. + */ + String properties(); + + /** + * Gets the metadata property: A JSON string containing metadata of the provider instance. + * + * @return the metadata value. + */ + String metadata(); + + /** + * Gets the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + HanaProvisioningStatesEnum provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner object. + * + * @return the inner object. + */ + ProviderInstanceInner innerModel(); + + /** The entirety of the ProviderInstance definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProviderInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the ProviderInstance definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProviderInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sapMonitorName. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @return the next definition stage. + */ + WithCreate withExistingSapMonitor(String resourceGroupName, String sapMonitorName); + } + /** + * The stage of the ProviderInstance 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.WithTypePropertiesType, + DefinitionStages.WithProperties, + DefinitionStages.WithMetadata { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProviderInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProviderInstance create(Context context); + } + /** The stage of the ProviderInstance definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of provider instance.. + * + * @param typePropertiesType The type of provider instance. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the ProviderInstance definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: A JSON string containing the properties of the provider instance.. + * + * @param properties A JSON string containing the properties of the provider instance. + * @return the next definition stage. + */ + WithCreate withProperties(String properties); + } + /** The stage of the ProviderInstance definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A JSON string containing metadata of the provider instance.. + * + * @param metadata A JSON string containing metadata of the provider instance. + * @return the next definition stage. + */ + WithCreate withMetadata(String metadata); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProviderInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProviderInstance refresh(Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstanceListResult.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstanceListResult.java new file mode 100644 index 000000000000..e77e2bf64618 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstanceListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List provider instances operation. */ +@Fluent +public final class ProviderInstanceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderInstanceListResult.class); + + /* + * The list of provider instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of provider instances. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of provider instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of provider instances. + * + * @param value the value value to set. + * @return the ProviderInstanceListResult object itself. + */ + public ProviderInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of provider instances. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of provider instances. + * + * @param nextLink the nextLink value to set. + * @return the ProviderInstanceListResult object itself. + */ + public ProviderInstanceListResult 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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.java new file mode 100644 index 000000000000..8078c4d4b55a --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.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.hanaonazure.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 ProviderInstances. */ +public interface ProviderInstances { + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 provider instances in the specified SAP monitor. + */ + PagedIterable list(String resourceGroupName, String sapMonitorName); + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP 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 a list of provider instances in the specified SAP monitor. + */ + PagedIterable list(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + ProviderInstance get(String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 sapMonitorName, String providerInstanceName); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @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 sapMonitorName, String providerInstanceName, Context context); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + ProviderInstance getById(String id); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @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); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @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 ProviderInstance resource. + * + * @param name resource name. + * @return the first stage of the new ProviderInstance definition. + */ + ProviderInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java new file mode 100644 index 000000000000..71e9b97c0f06 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import java.util.Map; + +/** An immutable client-side representation of SapMonitor. */ +public interface SapMonitor { + /** + * 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 provisioningState property: State of provisioning of the HanaInstance. + * + * @return the provisioningState value. + */ + HanaProvisioningStatesEnum provisioningState(); + + /** + * Gets the managedResourceGroupName property: The name of the resource group the SAP Monitor resources get deployed + * into. + * + * @return the managedResourceGroupName value. + */ + String managedResourceGroupName(); + + /** + * Gets the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + String logAnalyticsWorkspaceArmId(); + + /** + * Gets the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @return the enableCustomerAnalytics value. + */ + Boolean enableCustomerAnalytics(); + + /** + * Gets the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @return the logAnalyticsWorkspaceId value. + */ + String logAnalyticsWorkspaceId(); + + /** + * Gets the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceSharedKey value. + */ + String logAnalyticsWorkspaceSharedKey(); + + /** + * Gets the sapMonitorCollectorVersion property: The version of the payload running in the Collector VM. + * + * @return the sapMonitorCollectorVersion value. + */ + String sapMonitorCollectorVersion(); + + /** + * Gets the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + String monitorSubnet(); + + /** + * 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.hanaonazure.fluent.models.SapMonitorInner object. + * + * @return the inner object. + */ + SapMonitorInner innerModel(); + + /** The entirety of the SapMonitor definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SapMonitor definition stages. */ + interface DefinitionStages { + /** The first stage of the SapMonitor definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SapMonitor 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 SapMonitor definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SapMonitor 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.WithLogAnalyticsWorkspaceArmId, + DefinitionStages.WithEnableCustomerAnalytics, + DefinitionStages.WithLogAnalyticsWorkspaceId, + DefinitionStages.WithLogAnalyticsWorkspaceSharedKey, + DefinitionStages.WithMonitorSubnet { + /** + * Executes the create request. + * + * @return the created resource. + */ + SapMonitor create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SapMonitor create(Context context); + } + /** The stage of the SapMonitor 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 SapMonitor definition allowing to specify logAnalyticsWorkspaceArmId. */ + interface WithLogAnalyticsWorkspaceArmId { + /** + * Specifies the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used + * for monitoring. + * + * @param logAnalyticsWorkspaceArmId The ARM ID of the Log Analytics Workspace that is used for monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId); + } + /** The stage of the SapMonitor definition allowing to specify enableCustomerAnalytics. */ + interface WithEnableCustomerAnalytics { + /** + * Specifies the enableCustomerAnalytics property: The value indicating whether to send analytics to + * Microsoft. + * + * @param enableCustomerAnalytics The value indicating whether to send analytics to Microsoft. + * @return the next definition stage. + */ + WithCreate withEnableCustomerAnalytics(Boolean enableCustomerAnalytics); + } + /** The stage of the SapMonitor definition allowing to specify logAnalyticsWorkspaceId. */ + interface WithLogAnalyticsWorkspaceId { + /** + * Specifies the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be + * used for monitoring. + * + * @param logAnalyticsWorkspaceId The workspace ID of the log analytics workspace to be used for monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId); + } + /** The stage of the SapMonitor definition allowing to specify logAnalyticsWorkspaceSharedKey. */ + interface WithLogAnalyticsWorkspaceSharedKey { + /** + * Specifies the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that + * is used for monitoring. + * + * @param logAnalyticsWorkspaceSharedKey The shared key of the log analytics workspace that is used for + * monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey); + } + /** The stage of the SapMonitor definition allowing to specify monitorSubnet. */ + interface WithMonitorSubnet { + /** + * Specifies the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet The subnet which the SAP monitor will be deployed in. + * @return the next definition stage. + */ + WithCreate withMonitorSubnet(String monitorSubnet); + } + } + /** + * Begins update for the SapMonitor resource. + * + * @return the stage of resource update. + */ + SapMonitor.Update update(); + + /** The template for SapMonitor update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SapMonitor apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SapMonitor apply(Context context); + } + /** The SapMonitor update stages. */ + interface UpdateStages { + /** The stage of the SapMonitor update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags field of the resource.. + * + * @param tags Tags field of the resource. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SapMonitor refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapMonitor refresh(Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.java new file mode 100644 index 000000000000..ad1861fe29bb --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List SAP monitors operation. */ +@Fluent +public final class SapMonitorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SapMonitorListResult.class); + + /* + * The list of SAP monitors. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of SAP monitors. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of SAP monitors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of SAP monitors. + * + * @param value the value value to set. + * @return the SapMonitorListResult object itself. + */ + public SapMonitorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of SAP monitors. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of SAP monitors. + * + * @param nextLink the nextLink value to set. + * @return the SapMonitorListResult object itself. + */ + public SapMonitorListResult 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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.java new file mode 100644 index 000000000000..22437dd1037c --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.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.hanaonazure.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 SapMonitors. */ +public interface SapMonitors { + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * 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 a list of SAP monitors in the specified subscription. + */ + PagedIterable list(); + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * 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 a list of SAP monitors in the specified subscription. + */ + PagedIterable list(Context context); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + SapMonitor getByResourceGroup(String resourceGroupName, String sapMonitorName); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP 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 properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @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 sapMonitorName); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP 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. + */ + void delete(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @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 properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + SapMonitor getById(String id); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @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 properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @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); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @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 SapMonitor resource. + * + * @param name resource name. + * @return the first stage of the new SapMonitor definition. + */ + SapMonitor.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.java new file mode 100644 index 000000000000..ffa21963d4cf --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.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.hanaonazure.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tags field of the resource. */ +@Fluent +public final class Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Tags.class); + + /* + * Tags field of the resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Tags field of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags field of the resource. + * + * @param tags the tags value to set. + * @return the Tags object itself. + */ + public Tags withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/package-info.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/package-info.java new file mode 100644 index 000000000000..9e8b484d28a1 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/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 HanaManagementClient. HANA on Azure Client. */ +package com.azure.resourcemanager.hanaonazure.models; diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/package-info.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/package-info.java new file mode 100644 index 000000000000..bb2433d44093 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/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 HanaManagementClient. HANA on Azure Client. */ +package com.azure.resourcemanager.hanaonazure; diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/module-info.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/module-info.java new file mode 100644 index 000000000000..115817481f7b --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/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.hanaonazure { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.hanaonazure; + exports com.azure.resourcemanager.hanaonazure.fluent; + exports com.azure.resourcemanager.hanaonazure.fluent.models; + exports com.azure.resourcemanager.hanaonazure.models; + + opens com.azure.resourcemanager.hanaonazure.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hanaonazure.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/hanaonazure/ci.yml b/sdk/hanaonazure/ci.yml new file mode 100644 index 000000000000..1190aaf18439 --- /dev/null +++ b/sdk/hanaonazure/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/hanaonazure/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hanaonazure/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hanaonazure + Artifacts: + - name: azure-resourcemanager-hanaonazure + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhanaonazure diff --git a/sdk/hanaonazure/pom.xml b/sdk/hanaonazure/pom.xml new file mode 100644 index 000000000000..c74b647428de --- /dev/null +++ b/sdk/hanaonazure/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-hanaonazure-service + pom + 1.0.0 + + azure-resourcemanager-hanaonazure + +