From 30929134df7152dd2edf1b175169650ff17b417b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 23 Apr 2020 05:43:52 +0000 Subject: [PATCH] Generated from 60714c5be56a601fd212571d00c95686c44a0870 Fix example of get group ids --- .../mgmt-resource-manager/v2020_03_13/pom.xml | 135 ++ .../search/v2020_03_13/AdminKeyKind.java | 53 + .../search/v2020_03_13/AdminKeyResult.java | 30 + .../search/v2020_03_13/AdminKeys.java | 40 + .../CheckNameAvailabilityInput.java | 81 + .../CheckNameAvailabilityOutput.java | 35 + .../search/v2020_03_13/HostingMode.java | 53 + .../search/v2020_03_13/Identity.java | 73 + .../search/v2020_03_13/IdentityType.java | 53 + .../management/search/v2020_03_13/IpRule.java | 44 + .../search/v2020_03_13/NetworkRuleSet.java | 47 + .../search/v2020_03_13/Operation.java | 30 + .../search/v2020_03_13/OperationDisplay.java | 77 + .../search/v2020_03_13/Operations.java | 27 + .../PrivateEndpointConnection.java | 92 + .../PrivateEndpointConnectionProperties.java | 71 + ...ntConnectionPropertiesPrivateEndpoint.java | 44 + ...tiesPrivateLinkServiceConnectionState.java | 98 + .../PrivateEndpointConnections.java | 52 + .../v2020_03_13/PrivateLinkResource.java | 40 + .../PrivateLinkResourceProperties.java | 81 + .../v2020_03_13/PrivateLinkResources.java | 29 + .../PrivateLinkServiceConnectionStatus.java | 59 + .../search/v2020_03_13/ProvisioningState.java | 56 + .../v2020_03_13/PublicNetworkAccess.java | 53 + .../search/v2020_03_13/QueryKey.java | 30 + .../search/v2020_03_13/QueryKeys.java | 52 + .../SearchManagementRequestOptions.java | 46 + .../search/v2020_03_13/SearchService.java | 322 +++ .../v2020_03_13/SearchServiceStatus.java | 65 + .../search/v2020_03_13/Services.java | 34 + ...hareablePrivateLinkResourceProperties.java | 66 + .../ShareablePrivateLinkResourceType.java | 50 + .../SharedPrivateLinkResource.java | 106 + .../SharedPrivateLinkResourceProperties.java | 126 + .../SharedPrivateLinkResourceStatus.java | 62 + .../SharedPrivateLinkResources.java | 53 + .../management/search/v2020_03_13/Sku.java | 54 + .../search/v2020_03_13/SkuName.java | 68 + .../v2020_03_13/UnavailableNameReason.java | 41 + .../implementation/AdminKeyResultImpl.java | 36 + .../implementation/AdminKeyResultInner.java | 48 + .../implementation/AdminKeysImpl.java | 55 + .../implementation/AdminKeysInner.java | 434 ++++ .../CheckNameAvailabilityOutputImpl.java | 42 + .../CheckNameAvailabilityOutputInner.java | 69 + .../implementation/IdParsingUtils.java | 57 + .../implementation/OperationImpl.java | 37 + .../implementation/OperationInner.java | 49 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 134 ++ .../v2020_03_13/implementation/PageImpl.java | 75 + .../v2020_03_13/implementation/PageImpl1.java | 75 + .../PrivateEndpointConnectionImpl.java | 126 + .../PrivateEndpointConnectionInner.java | 103 + .../PrivateEndpointConnectionsImpl.java | 76 + .../PrivateEndpointConnectionsInner.java | 1153 +++++++++ .../PrivateLinkResourceImpl.java | 51 + .../PrivateLinkResourceInner.java | 80 + .../PrivateLinkResourcesImpl.java | 53 + .../PrivateLinkResourcesInner.java | 250 ++ .../implementation/QueryKeyImpl.java | 36 + .../implementation/QueryKeyInner.java | 48 + .../implementation/QueryKeysImpl.java | 68 + .../implementation/QueryKeysInner.java | 941 ++++++++ .../SearchManagementClientImpl.java | 280 +++ .../implementation/SearchManager.java | 171 ++ .../implementation/SearchServiceImpl.java | 206 ++ .../implementation/SearchServiceInner.java | 329 +++ .../implementation/ServicesImpl.java | 151 ++ .../implementation/ServicesInner.java | 2089 +++++++++++++++++ .../SharedPrivateLinkResourceImpl.java | 124 + .../SharedPrivateLinkResourceInner.java | 72 + .../SharedPrivateLinkResourcesImpl.java | 85 + .../SharedPrivateLinkResourcesInner.java | 1152 +++++++++ .../implementation/package-info.java | 11 + .../search/v2020_03_13/package-info.java | 11 + 77 files changed, 11454 insertions(+) create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/pom.xml create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyKind.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyResult.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeys.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityInput.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityOutput.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/HostingMode.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Identity.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IdentityType.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IpRule.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/NetworkRuleSet.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operation.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/OperationDisplay.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operations.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionProperties.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateEndpoint.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnections.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResource.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResourceProperties.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResources.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkServiceConnectionStatus.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ProvisioningState.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PublicNetworkAccess.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKey.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKeys.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchManagementRequestOptions.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchService.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchServiceStatus.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Services.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceProperties.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceType.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceProperties.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceStatus.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResources.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Sku.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SkuName.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/UnavailableNameReason.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/IdParsingUtils.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl1.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManagementClientImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManager.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesImpl.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/package-info.java create mode 100644 sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/package-info.java diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/pom.xml b/sdk/search/mgmt-resource-manager/v2020_03_13/pom.xml new file mode 100644 index 0000000000000..985a8e60145a3 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.search.v2020_03_13 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-search + 1.0.0-beta + jar + Microsoft Azure SDK for Search Management + This package contains Microsoft Search Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyKind.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyKind.java new file mode 100644 index 0000000000000..4f4b1a6e48fe5 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyKind.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AdminKeyKind. + */ +public enum AdminKeyKind { + /** Enum value primary. */ + PRIMARY("primary"), + + /** Enum value secondary. */ + SECONDARY("secondary"); + + /** The actual serialized value for a AdminKeyKind instance. */ + private String value; + + AdminKeyKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AdminKeyKind instance. + * + * @param value the serialized value to parse. + * @return the parsed AdminKeyKind object, or null if unable to parse. + */ + @JsonCreator + public static AdminKeyKind fromString(String value) { + AdminKeyKind[] items = AdminKeyKind.values(); + for (AdminKeyKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyResult.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyResult.java new file mode 100644 index 0000000000000..d5fd5e2a06e30 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeyResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.AdminKeyResultInner; + +/** + * Type representing AdminKeyResult. + */ +public interface AdminKeyResult extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the secondaryKey value. + */ + String secondaryKey(); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeys.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeys.java new file mode 100644 index 0000000000000..4b6b6fddce8a2 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/AdminKeys.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.implementation.AdminKeysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AdminKeys. + */ +public interface AdminKeys extends HasInner { + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String searchServiceName); + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityInput.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityInput.java new file mode 100644 index 0000000000000..935f4ead63e7a --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityInput.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input of check name availability API. + */ +public class CheckNameAvailabilityInput { + /** + * The Search service name to validate. Search service names must only + * contain lowercase letters, digits or dashes, cannot use dash as the + * first two or last one characters, cannot contain consecutive dashes, and + * must be between 2 and 60 characters in length. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of the resource whose name is to be validated. This value must + * always be 'searchServices'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityInput class. + * @param name the Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + */ + public CheckNameAvailabilityInput() { + type = "searchServices"; + } + + /** + * Get the Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * + * @param name the name value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the resource whose name is to be validated. This value must always be 'searchServices'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the resource whose name is to be validated. This value must always be 'searchServices'. + * + * @param type the type value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityOutput.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityOutput.java new file mode 100644 index 0000000000000..66f833c6ef25a --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/CheckNameAvailabilityOutput.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.CheckNameAvailabilityOutputInner; + +/** + * Type representing CheckNameAvailabilityOutput. + */ +public interface CheckNameAvailabilityOutput extends HasInner, HasManager { + /** + * @return the isNameAvailable value. + */ + Boolean isNameAvailable(); + + /** + * @return the message value. + */ + String message(); + + /** + * @return the reason value. + */ + UnavailableNameReason reason(); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/HostingMode.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/HostingMode.java new file mode 100644 index 0000000000000..57902b51647d9 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/HostingMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HostingMode. + */ +public enum HostingMode { + /** Enum value default. */ + DEFAULT("default"), + + /** Enum value highDensity. */ + HIGH_DENSITY("highDensity"); + + /** The actual serialized value for a HostingMode instance. */ + private String value; + + HostingMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HostingMode instance. + * + * @param value the serialized value to parse. + * @return the parsed HostingMode object, or null if unable to parse. + */ + @JsonCreator + public static HostingMode fromString(String value) { + HostingMode[] items = HostingMode.values(); + for (HostingMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Identity.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Identity.java new file mode 100644 index 0000000000000..1e7bc2d0cc36e --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Identity.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'None', 'SystemAssigned'. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'None', 'SystemAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'None', 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IdentityType.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IdentityType.java new file mode 100644 index 0000000000000..cdf21f12c17a4 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IdentityType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IdentityType. + */ +public enum IdentityType { + /** Enum value None. */ + NONE("None"), + + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a IdentityType instance. */ + private String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IpRule.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IpRule.java new file mode 100644 index 0000000000000..8e2a04bedc67d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/IpRule.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP restriction rule of the Azure Cognitive Search service. + */ +public class IpRule { + /** + * Value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP + * range in CIDR format (eg., 123.1.2.3/24) to be allowed. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed. + * + * @param value the value value to set + * @return the IpRule object itself. + */ + public IpRule withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/NetworkRuleSet.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/NetworkRuleSet.java new file mode 100644 index 0000000000000..0c1aea948a98d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/NetworkRuleSet.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network specific rules that determine how the Azure Cognitive Search service + * may be reached. + */ +public class NetworkRuleSet { + /** + * A list of IP restriction rules that defines the inbound network access + * to the search service endpoint. These restriction rules are applied only + * when the EndpointAccess of the search service is Public. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Get a list of IP restriction rules that defines the inbound network access to the search service endpoint. These restriction rules are applied only when the EndpointAccess of the search service is Public. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set a list of IP restriction rules that defines the inbound network access to the search service endpoint. These restriction rules are applied only when the EndpointAccess of the search service is Public. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operation.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operation.java new file mode 100644 index 0000000000000..477b4e811b80f --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/OperationDisplay.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/OperationDisplay.java new file mode 100644 index 0000000000000..f480d1086e8c3 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operation. + */ +public class OperationDisplay { + /** + * The friendly name of the resource provider. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The operation type: read, write, delete, listKeys/action, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The resource type on which the operation is performed. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the friendly name of the resource provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the operation type: read, write, delete, listKeys/action, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the resource type on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the friendly name of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operations.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operations.java new file mode 100644 index 0000000000000..bd453e37731c0 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..5acc3989eb306 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnection.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.search.v2020_03_13.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import java.util.UUID; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSearchManagementRequestOptions, UpdateStages.WithId, UpdateStages.WithProperties { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify SearchManagementRequestOptions. + */ + interface WithSearchManagementRequestOptions { + /** + * Specifies searchManagementRequestOptions. + * @param searchManagementRequestOptions Additional parameters for the operation + * @return the next update stage + */ + Update withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); + } + + /** + * The stage of the privateendpointconnection update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + * @param id The ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together + * @return the next update stage + */ + Update withId(String id); + } + + /** + * The stage of the privateendpointconnection update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service + * @return the next update stage + */ + Update withProperties(PrivateEndpointConnectionProperties properties); + } + + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionProperties.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..1816c67821ebe --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionProperties.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of an existing Private Endpoint connection to the + * Azure Cognitive Search service. + */ +public class PrivateEndpointConnectionProperties { + /** + * The private endpoint resource from Microsoft.Network provider. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpointConnectionPropertiesPrivateEndpoint privateEndpoint; + + /** + * Describes the current state of an existing Private Link Service + * connection to the Azure Private Endpoint. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the private endpoint resource from Microsoft.Network provider. + * + * @return the privateEndpoint value + */ + public PrivateEndpointConnectionPropertiesPrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the private endpoint resource from Microsoft.Network provider. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpointConnectionPropertiesPrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get describes the current state of an existing Private Link Service connection to the Azure Private Endpoint. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set describes the current state of an existing Private Link Service connection to the Azure Private Endpoint. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState(PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateEndpoint.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateEndpoint.java new file mode 100644 index 0000000000000..d2f549dde81f6 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateEndpoint.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The private endpoint resource from Microsoft.Network provider. + */ +public class PrivateEndpointConnectionPropertiesPrivateEndpoint { + /** + * The resource id of the private endpoint resource from Microsoft.Network + * provider. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the resource id of the private endpoint resource from Microsoft.Network provider. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource id of the private endpoint resource from Microsoft.Network provider. + * + * @param id the id value to set + * @return the PrivateEndpointConnectionPropertiesPrivateEndpoint object itself. + */ + public PrivateEndpointConnectionPropertiesPrivateEndpoint withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..57f917c5e3de5 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the current state of an existing Private Link Service connection + * to the Azure Private Endpoint. + */ +public class PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState { + /** + * Status of the the private link service connection. Can be Pending, + * Approved, Rejected, or Disconnected. Possible values include: 'Pending', + * 'Approved', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private PrivateLinkServiceConnectionStatus status; + + /** + * The description for the private link service connection state. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A description of any extra actions that may be required. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get status of the the private link service connection. Can be Pending, Approved, Rejected, or Disconnected. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PrivateLinkServiceConnectionStatus status() { + return this.status; + } + + /** + * Set status of the the private link service connection. Can be Pending, Approved, Rejected, or Disconnected. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState object itself. + */ + public PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState withStatus(PrivateLinkServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description for the private link service connection state. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the private link service connection state. + * + * @param description the description value to set + * @return the PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState object itself. + */ + public PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a description of any extra actions that may be required. + * + * @return the actionsRequired value + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set a description of any extra actions that may be required. + * + * @param actionsRequired the actionsRequired value to set + * @return the PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState object itself. + */ + public PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnections.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..eea7b0fa93736 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateEndpointConnections.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends HasInner { + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName); + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServiceAsync(final String resourceGroupName, final String searchServiceName); + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResource.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResource.java new file mode 100644 index 0000000000000..436129bd9ba79 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResource.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.search.v2020_03_13.implementation.PrivateLinkResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResourceProperties.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..4a5702b17ddc8 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a supported private link resource for the Azure + * Cognitive Search service. For a given API version, this represents the + * 'supported' groupIds when creating a shared private link resource. + */ +public class PrivateLinkResourceProperties { + /** + * The group ID of the private link resource. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The list of required members of the private link resource. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * The list of required DNS zone names of the private link resource. + */ + @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * The list of resources that are onboarded to private link service, that + * are supported by Azure Cognitive Search. + */ + @JsonProperty(value = "shareablePrivateLinkResourceTypes", access = JsonProperty.Access.WRITE_ONLY) + private List shareablePrivateLinkResourceTypes; + + /** + * Get the group ID of the private link resource. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the list of required members of the private link resource. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the list of required DNS zone names of the private link resource. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Get the list of resources that are onboarded to private link service, that are supported by Azure Cognitive Search. + * + * @return the shareablePrivateLinkResourceTypes value + */ + public List shareablePrivateLinkResourceTypes() { + return this.shareablePrivateLinkResourceTypes; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResources.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResources.java new file mode 100644 index 0000000000000..790f43bec7e6d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkResources.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSupportedAsync(String resourceGroupName, String searchServiceName); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkServiceConnectionStatus.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkServiceConnectionStatus.java new file mode 100644 index 0000000000000..e8bd8f64da697 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PrivateLinkServiceConnectionStatus.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PrivateLinkServiceConnectionStatus. + */ +public enum PrivateLinkServiceConnectionStatus { + /** Enum value Pending. */ + PENDING("Pending"), + + /** Enum value Approved. */ + APPROVED("Approved"), + + /** Enum value Rejected. */ + REJECTED("Rejected"), + + /** Enum value Disconnected. */ + DISCONNECTED("Disconnected"); + + /** The actual serialized value for a PrivateLinkServiceConnectionStatus instance. */ + private String value; + + PrivateLinkServiceConnectionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PrivateLinkServiceConnectionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed PrivateLinkServiceConnectionStatus object, or null if unable to parse. + */ + @JsonCreator + public static PrivateLinkServiceConnectionStatus fromString(String value) { + PrivateLinkServiceConnectionStatus[] items = PrivateLinkServiceConnectionStatus.values(); + for (PrivateLinkServiceConnectionStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ProvisioningState.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ProvisioningState.java new file mode 100644 index 0000000000000..4ec517dcef1e2 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ProvisioningState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningState. + */ +public enum ProvisioningState { + /** Enum value succeeded. */ + SUCCEEDED("succeeded"), + + /** Enum value provisioning. */ + PROVISIONING("provisioning"), + + /** Enum value failed. */ + FAILED("failed"); + + /** The actual serialized value for a ProvisioningState instance. */ + private String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PublicNetworkAccess.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PublicNetworkAccess.java new file mode 100644 index 0000000000000..904d9146fa7e8 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/PublicNetworkAccess.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PublicNetworkAccess. + */ +public enum PublicNetworkAccess { + /** Enum value enabled. */ + ENABLED("enabled"), + + /** Enum value disabled. */ + DISABLED("disabled"); + + /** The actual serialized value for a PublicNetworkAccess instance. */ + private String value; + + PublicNetworkAccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PublicNetworkAccess instance. + * + * @param value the serialized value to parse. + * @return the parsed PublicNetworkAccess object, or null if unable to parse. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String value) { + PublicNetworkAccess[] items = PublicNetworkAccess.values(); + for (PublicNetworkAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKey.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKey.java new file mode 100644 index 0000000000000..a95370e6aff96 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKey.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.QueryKeyInner; + +/** + * Type representing QueryKey. + */ +public interface QueryKey extends HasInner, HasManager { + /** + * @return the key value. + */ + String keyVal(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKeys.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKeys.java new file mode 100644 index 0000000000000..2dbf0bd2d9cfa --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/QueryKeys.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.implementation.QueryKeysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing QueryKeys. + */ +public interface QueryKeys extends HasInner { + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String searchServiceName, String name); + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySearchServiceAsync(final String resourceGroupName, final String searchServiceName); + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String searchServiceName, String key); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchManagementRequestOptions.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchManagementRequestOptions.java new file mode 100644 index 0000000000000..43ea96a0a30f1 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchManagementRequestOptions.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for a set of operations. + */ +public class SearchManagementRequestOptions { + /** + * A client-generated GUID value that identifies this request. If + * specified, this will be included in response information as a way to + * track the request. + */ + @JsonProperty(value = "") + private UUID clientRequestId; + + /** + * Get a client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. + * + * @return the clientRequestId value + */ + public UUID clientRequestId() { + return this.clientRequestId; + } + + /** + * Set a client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request. + * + * @param clientRequestId the clientRequestId value to set + * @return the SearchManagementRequestOptions object itself. + */ + public SearchManagementRequestOptions withClientRequestId(UUID clientRequestId) { + this.clientRequestId = clientRequestId; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchService.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchService.java new file mode 100644 index 0000000000000..ce486a2b1554c --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchService.java @@ -0,0 +1,322 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchServiceInner; + +/** + * Type representing SearchService. + */ +public interface SearchService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the hostingMode value. + */ + HostingMode hostingMode(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * @return the partitionCount value. + */ + Integer partitionCount(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * @return the replicaCount value. + */ + Integer replicaCount(); + + /** + * @return the sharedPrivateLinkResources value. + */ + List sharedPrivateLinkResources(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + SearchServiceStatus status(); + + /** + * @return the statusDetails value. + */ + String statusDetails(); + + /** + * The entirety of the SearchService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSearchManagementRequestOptions, DefinitionStages.WithCreate { + } + + /** + * Grouping of SearchService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SearchService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the SearchService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the searchservice definition allowing to specify SearchManagementRequestOptions. + */ + interface WithSearchManagementRequestOptions { + /** + * Specifies searchManagementRequestOptions. + * @param searchManagementRequestOptions Additional parameters for the operation + * @return the next definition stage +*/ + WithCreate withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); + } + + /** + * The stage of the searchservice definition allowing to specify HostingMode. + */ + interface WithHostingMode { + /** + * Specifies hostingMode. + * @param hostingMode Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. Possible values include: 'default', 'highDensity' + * @return the next definition stage + */ + WithCreate withHostingMode(HostingMode hostingMode); + } + + /** + * The stage of the searchservice definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the searchservice definition allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet Network specific rules that determine how the Azure Cognitive Search service may be reached + * @return the next definition stage + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the searchservice definition allowing to specify PartitionCount. + */ + interface WithPartitionCount { + /** + * Specifies partitionCount. + * @param partitionCount The number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3 + * @return the next definition stage + */ + WithCreate withPartitionCount(Integer partitionCount); + } + + /** + * The stage of the searchservice definition allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. Possible values include: 'enabled', 'disabled' + * @return the next definition stage + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the searchservice definition allowing to specify ReplicaCount. + */ + interface WithReplicaCount { + /** + * Specifies replicaCount. + * @param replicaCount The number of replicas in the Search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU + * @return the next definition stage + */ + WithCreate withReplicaCount(Integer replicaCount); + } + + /** + * The stage of the searchservice definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithHostingMode, DefinitionStages.WithIdentity, DefinitionStages.WithNetworkRuleSet, DefinitionStages.WithPartitionCount, DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithReplicaCount, DefinitionStages.WithSku { + } + } + /** + * The template for a SearchService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSearchManagementRequestOptions, UpdateStages.WithHostingMode, UpdateStages.WithIdentity, UpdateStages.WithNetworkRuleSet, UpdateStages.WithPartitionCount, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithReplicaCount, UpdateStages.WithSku { + } + + /** + * Grouping of SearchService update stages. + */ + interface UpdateStages { + /** + * The stage of the searchservice update allowing to specify SearchManagementRequestOptions. + */ + interface WithSearchManagementRequestOptions { + /** + * Specifies searchManagementRequestOptions. + * @param searchManagementRequestOptions Additional parameters for the operation + * @return the next update stage + */ + Update withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); + } + + /** + * The stage of the searchservice update allowing to specify HostingMode. + */ + interface WithHostingMode { + /** + * Specifies hostingMode. + * @param hostingMode Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. Possible values include: 'default', 'highDensity' + * @return the next update stage + */ + Update withHostingMode(HostingMode hostingMode); + } + + /** + * The stage of the searchservice update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the searchservice update allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet Network specific rules that determine how the Azure Cognitive Search service may be reached + * @return the next update stage + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the searchservice update allowing to specify PartitionCount. + */ + interface WithPartitionCount { + /** + * Specifies partitionCount. + * @param partitionCount The number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3 + * @return the next update stage + */ + Update withPartitionCount(Integer partitionCount); + } + + /** + * The stage of the searchservice update allowing to specify PublicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies publicNetworkAccess. + * @param publicNetworkAccess This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. Possible values include: 'enabled', 'disabled' + * @return the next update stage + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the searchservice update allowing to specify ReplicaCount. + */ + interface WithReplicaCount { + /** + * Specifies replicaCount. + * @param replicaCount The number of replicas in the Search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU + * @return the next update stage + */ + Update withReplicaCount(Integer replicaCount); + } + + /** + * The stage of the searchservice update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchServiceStatus.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchServiceStatus.java new file mode 100644 index 0000000000000..d603ea7cef2e8 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SearchServiceStatus.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SearchServiceStatus. + */ +public enum SearchServiceStatus { + /** Enum value running. */ + RUNNING("running"), + + /** Enum value provisioning. */ + PROVISIONING("provisioning"), + + /** Enum value deleting. */ + DELETING("deleting"), + + /** Enum value degraded. */ + DEGRADED("degraded"), + + /** Enum value disabled. */ + DISABLED("disabled"), + + /** Enum value error. */ + ERROR("error"); + + /** The actual serialized value for a SearchServiceStatus instance. */ + private String value; + + SearchServiceStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SearchServiceStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed SearchServiceStatus object, or null if unable to parse. + */ + @JsonCreator + public static SearchServiceStatus fromString(String value) { + SearchServiceStatus[] items = SearchServiceStatus.values(); + for (SearchServiceStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Services.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Services.java new file mode 100644 index 0000000000000..ee1c2440e8a2c --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Services.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.search.v2020_03_13.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Services. + */ +public interface Services extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceProperties.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..cf5790f19a922 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceProperties.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a resource type that has been onboarded to + * private link service, supported by Azure Cognitive Search. + */ +public class ShareablePrivateLinkResourceProperties { + /** + * The resource provider type for the resource that has been onboarded to + * private link service, supported by Azure Cognitive Search. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The resource provider group id for the resource that has been onboarded + * to private link service, supported by Azure Cognitive Search. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The description of the resource type that has been onboarded to private + * link service, supported by Azure Cognitive Search. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the resource provider type for the resource that has been onboarded to private link service, supported by Azure Cognitive Search. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the resource provider group id for the resource that has been onboarded to private link service, supported by Azure Cognitive Search. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the description of the resource type that has been onboarded to private link service, supported by Azure Cognitive Search. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceType.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceType.java new file mode 100644 index 0000000000000..f6eaed7b2c91c --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/ShareablePrivateLinkResourceType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an resource type that has been onboarded to private link service, + * supported by Azure Cognitive Search. + */ +public class ShareablePrivateLinkResourceType { + /** + * The name of the resource type that has been onboarded to private link + * service, supported by Azure Cognitive Search. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Describes the properties of a resource type that has been onboarded to + * private link service, supported by Azure Cognitive Search. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ShareablePrivateLinkResourceProperties properties; + + /** + * Get the name of the resource type that has been onboarded to private link service, supported by Azure Cognitive Search. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get describes the properties of a resource type that has been onboarded to private link service, supported by Azure Cognitive Search. + * + * @return the properties value + */ + public ShareablePrivateLinkResourceProperties properties() { + return this.properties; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java new file mode 100644 index 0000000000000..31e478ba31619 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResource.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SharedPrivateLinkResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SearchManager; +import java.util.UUID; + +/** + * Type representing SharedPrivateLinkResource. + */ +public interface SharedPrivateLinkResource extends HasInner, Indexable, HasManager { + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + SharedPrivateLinkResourceProperties properties(); + + /** + * The entirety of the SharedPrivateLinkResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSearchService, DefinitionStages.WithSearchManagementRequestOptions, DefinitionStages.WithCreate { + } + + /** + * Grouping of SharedPrivateLinkResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SharedPrivateLinkResource definition. + */ + interface Blank extends WithSearchService { + } + + /** + * The stage of the sharedprivatelinkresource definition allowing to specify SearchService. + */ + interface WithSearchService { + /** + * Specifies resourceGroupName, searchServiceName. + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group + * @return the next definition stage + */ + WithSearchManagementRequestOptions withExistingSearchService(String resourceGroupName, String searchServiceName); + } + + /** + * The stage of the sharedprivatelinkresource definition allowing to specify SearchManagementRequestOptions. + */ + interface WithSearchManagementRequestOptions { + /** + * Specifies searchManagementRequestOptions. + * @param searchManagementRequestOptions Additional parameters for the operation + * @return the next definition stage + */ + WithCreate withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions); + } + + /** + * The stage of the sharedprivatelinkresource definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + * @param name The name of the shared private link resource + * @return the next definition stage + */ + WithCreate withName(String name); + } + + /** + * The stage of the sharedprivatelinkresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service + * @return the next definition stage + */ + WithCreate withProperties(SharedPrivateLinkResourceProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithName, DefinitionStages.WithProperties { + } + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceProperties.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..3bf4919f1b9b7 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceProperties.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of an existing Shared Private Link Resource managed + * by the Azure Cognitive Search service. + */ +public class SharedPrivateLinkResourceProperties { + /** + * The resource id of the resource the shared private link resource is for. + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /** + * The group id from the provider of resource the shared private link + * resource is for. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /** + * The request message for requesting approval of the shared private link + * resource. + */ + @JsonProperty(value = "requestMessage") + private String requestMessage; + + /** + * Status of the shared private link resource. Can be Pending, Approved, + * Rejected, Disconnected, or Timeout. Possible values include: 'Pending', + * 'Approved', 'Rejected', 'Disconnected', 'Timeout'. + */ + @JsonProperty(value = "status") + private SharedPrivateLinkResourceStatus status; + + /** + * Get the resource id of the resource the shared private link resource is for. + * + * @return the privateLinkResourceId value + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the resource id of the resource the shared private link resource is for. + * + * @param privateLinkResourceId the privateLinkResourceId value to set + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the group id from the provider of resource the shared private link resource is for. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the group id from the provider of resource the shared private link resource is for. + * + * @param groupId the groupId value to set + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the request message for requesting approval of the shared private link resource. + * + * @return the requestMessage value + */ + public String requestMessage() { + return this.requestMessage; + } + + /** + * Set the request message for requesting approval of the shared private link resource. + * + * @param requestMessage the requestMessage value to set + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withRequestMessage(String requestMessage) { + this.requestMessage = requestMessage; + return this; + } + + /** + * Get status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout'. + * + * @return the status value + */ + public SharedPrivateLinkResourceStatus status() { + return this.status; + } + + /** + * Set status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout'. + * + * @param status the status value to set + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withStatus(SharedPrivateLinkResourceStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceStatus.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceStatus.java new file mode 100644 index 0000000000000..e74f55d8b713d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResourceStatus.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SharedPrivateLinkResourceStatus. + */ +public enum SharedPrivateLinkResourceStatus { + /** Enum value Pending. */ + PENDING("Pending"), + + /** Enum value Approved. */ + APPROVED("Approved"), + + /** Enum value Rejected. */ + REJECTED("Rejected"), + + /** Enum value Disconnected. */ + DISCONNECTED("Disconnected"), + + /** Enum value Timeout. */ + TIMEOUT("Timeout"); + + /** The actual serialized value for a SharedPrivateLinkResourceStatus instance. */ + private String value; + + SharedPrivateLinkResourceStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SharedPrivateLinkResourceStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed SharedPrivateLinkResourceStatus object, or null if unable to parse. + */ + @JsonCreator + public static SharedPrivateLinkResourceStatus fromString(String value) { + SharedPrivateLinkResourceStatus[] items = SharedPrivateLinkResourceStatus.values(); + for (SharedPrivateLinkResourceStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResources.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResources.java new file mode 100644 index 0000000000000..3884ab2430f5b --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SharedPrivateLinkResources.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.implementation.SharedPrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SharedPrivateLinkResources. + */ +public interface SharedPrivateLinkResources extends SupportsCreating, HasInner { + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName); + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServiceAsync(final String resourceGroupName, final String searchServiceName); + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName); + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Sku.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Sku.java new file mode 100644 index 0000000000000..85bc36ca9ee12 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/Sku.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the SKU of an Azure Cognitive Search Service, which determines price + * tier and capacity limits. + */ +public class Sku { + /** + * The SKU of the Search service. Valid values include: 'free': Shared + * service. 'basic': Dedicated service with up to 3 replicas. 'standard': + * Dedicated service with up to 12 partitions and 12 replicas. 'standard2': + * Similar to standard, but with more capacity per search unit. + * 'standard3': The largest Standard offering with up to 12 partitions and + * 12 replicas (or up to 3 partitions with more indexes if you also set the + * hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports + * 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports + * 2TB per partition, up to 12 partitions.'. Possible values include: + * 'free', 'basic', 'standard', 'standard2', 'standard3', + * 'storage_optimized_l1', 'storage_optimized_l2'. + */ + @JsonProperty(value = "name") + private SkuName name; + + /** + * Get the SKU of the Search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. 'standard': Dedicated service with up to 12 partitions and 12 replicas. 'standard2': Similar to standard, but with more capacity per search unit. 'standard3': The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports 2TB per partition, up to 12 partitions.'. Possible values include: 'free', 'basic', 'standard', 'standard2', 'standard3', 'storage_optimized_l1', 'storage_optimized_l2'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the SKU of the Search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. 'standard': Dedicated service with up to 12 partitions and 12 replicas. 'standard2': Similar to standard, but with more capacity per search unit. 'standard3': The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports 2TB per partition, up to 12 partitions.'. Possible values include: 'free', 'basic', 'standard', 'standard2', 'standard3', 'storage_optimized_l1', 'storage_optimized_l2'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SkuName.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SkuName.java new file mode 100644 index 0000000000000..a2a27730695fe --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/SkuName.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuName. + */ +public enum SkuName { + /** Enum value free. */ + FREE("free"), + + /** Enum value basic. */ + BASIC("basic"), + + /** Enum value standard. */ + STANDARD("standard"), + + /** Enum value standard2. */ + STANDARD2("standard2"), + + /** Enum value standard3. */ + STANDARD3("standard3"), + + /** Enum value storage_optimized_l1. */ + STORAGE_OPTIMIZED_L1("storage_optimized_l1"), + + /** Enum value storage_optimized_l2. */ + STORAGE_OPTIMIZED_L2("storage_optimized_l2"); + + /** The actual serialized value for a SkuName instance. */ + private String value; + + SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/UnavailableNameReason.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/UnavailableNameReason.java new file mode 100644 index 0000000000000..d9af21eecbe33 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/UnavailableNameReason.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UnavailableNameReason. + */ +public final class UnavailableNameReason extends ExpandableStringEnum { + /** Static value Invalid for UnavailableNameReason. */ + public static final UnavailableNameReason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for UnavailableNameReason. */ + public static final UnavailableNameReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a UnavailableNameReason from its string representation. + * @param name a name to look for + * @return the corresponding UnavailableNameReason + */ + @JsonCreator + public static UnavailableNameReason fromString(String name) { + return fromString(name, UnavailableNameReason.class); + } + + /** + * @return known UnavailableNameReason values + */ + public static Collection values() { + return values(UnavailableNameReason.class); + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultImpl.java new file mode 100644 index 0000000000000..00bc442642cbb --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.AdminKeyResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AdminKeyResultImpl extends WrapperImpl implements AdminKeyResult { + private final SearchManager manager; + AdminKeyResultImpl(AdminKeyResultInner inner, SearchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SearchManager manager() { + return this.manager; + } + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String secondaryKey() { + return this.inner().secondaryKey(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultInner.java new file mode 100644 index 0000000000000..2ac7bf651f800 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeyResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing the primary and secondary admin API keys for a given + * Azure Cognitive Search service. + */ +public class AdminKeyResultInner { + /** + * The primary admin API key of the Search service. + */ + @JsonProperty(value = "primaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryKey; + + /** + * The secondary admin API key of the Search service. + */ + @JsonProperty(value = "secondaryKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryKey; + + /** + * Get the primary admin API key of the Search service. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Get the secondary admin API key of the Search service. + * + * @return the secondaryKey value + */ + public String secondaryKey() { + return this.secondaryKey; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysImpl.java new file mode 100644 index 0000000000000..7591490ab99d9 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.AdminKeys; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.AdminKeyResult; +import com.microsoft.azure.management.search.v2020_03_13.AdminKeyKind; + +class AdminKeysImpl extends WrapperImpl implements AdminKeys { + private final SearchManager manager; + + AdminKeysImpl(SearchManager manager) { + super(manager.inner().adminKeys()); + this.manager = manager; + } + + public SearchManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String searchServiceName) { + AdminKeysInner client = this.inner(); + return client.getAsync(resourceGroupName, searchServiceName) + .map(new Func1() { + @Override + public AdminKeyResult call(AdminKeyResultInner inner) { + return new AdminKeyResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind) { + AdminKeysInner client = this.inner(); + return client.regenerateAsync(resourceGroupName, searchServiceName, keyKind) + .map(new Func1() { + @Override + public AdminKeyResult call(AdminKeyResultInner inner) { + return new AdminKeyResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysInner.java new file mode 100644 index 0000000000000..e007b776be3b9 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/AdminKeysInner.java @@ -0,0 +1,434 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.search.v2020_03_13.AdminKeyKind; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AdminKeys. + */ +public class AdminKeysInner { + /** The Retrofit service to perform REST calls. */ + private AdminKeysService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of AdminKeysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AdminKeysInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(AdminKeysService.class); + this.client = client; + } + + /** + * The interface defining all the services for AdminKeys to be + * used by Retrofit to perform actually REST calls. + */ + interface AdminKeysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.AdminKeys get" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.AdminKeys regenerate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/regenerateAdminKey/{keyKind}") + Observable> regenerate(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("keyKind") AdminKeyKind keyKind, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AdminKeyResultInner object if successful. + */ + public AdminKeyResultInner get(String resourceGroupName, String searchServiceName) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName).toBlocking().single().body(); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String searchServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, searchServiceName), serviceCallback); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable getAsync(String resourceGroupName, String searchServiceName) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName).map(new Func1, AdminKeyResultInner>() { + @Override + public AdminKeyResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String searchServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.get(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AdminKeyResultInner object if successful. + */ + public AdminKeyResultInner get(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable getAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).map(new Func1, AdminKeyResultInner>() { + @Override + public AdminKeyResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.get(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AdminKeyResultInner object if successful. + */ + public AdminKeyResultInner regenerate(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind) { + return regenerateWithServiceResponseAsync(resourceGroupName, searchServiceName, keyKind).toBlocking().single().body(); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateWithServiceResponseAsync(resourceGroupName, searchServiceName, keyKind), serviceCallback); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable regenerateAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind) { + return regenerateWithServiceResponseAsync(resourceGroupName, searchServiceName, keyKind).map(new Func1, AdminKeyResultInner>() { + @Override + public AdminKeyResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable> regenerateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (keyKind == null) { + throw new IllegalArgumentException("Parameter keyKind is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.regenerate(resourceGroupName, searchServiceName, keyKind, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AdminKeyResultInner object if successful. + */ + public AdminKeyResultInner regenerate(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind, SearchManagementRequestOptions searchManagementRequestOptions) { + return regenerateWithServiceResponseAsync(resourceGroupName, searchServiceName, keyKind, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateWithServiceResponseAsync(resourceGroupName, searchServiceName, keyKind, searchManagementRequestOptions), serviceCallback); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable regenerateAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind, SearchManagementRequestOptions searchManagementRequestOptions) { + return regenerateWithServiceResponseAsync(resourceGroupName, searchServiceName, keyKind, searchManagementRequestOptions).map(new Func1, AdminKeyResultInner>() { + @Override + public AdminKeyResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', 'secondary' + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdminKeyResultInner object + */ + public Observable> regenerateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, AdminKeyKind keyKind, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (keyKind == null) { + throw new IllegalArgumentException("Parameter keyKind is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.regenerate(resourceGroupName, searchServiceName, keyKind, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputImpl.java new file mode 100644 index 0000000000000..2d33ad9222df4 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.CheckNameAvailabilityOutput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.UnavailableNameReason; + +class CheckNameAvailabilityOutputImpl extends WrapperImpl implements CheckNameAvailabilityOutput { + private final SearchManager manager; + CheckNameAvailabilityOutputImpl(CheckNameAvailabilityOutputInner inner, SearchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SearchManager manager() { + return this.manager; + } + + @Override + public Boolean isNameAvailable() { + return this.inner().isNameAvailable(); + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public UnavailableNameReason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputInner.java new file mode 100644 index 0000000000000..0d782d4e694d6 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/CheckNameAvailabilityOutputInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.UnavailableNameReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of check name availability API. + */ +public class CheckNameAvailabilityOutputInner { + /** + * A value indicating whether the name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isNameAvailable; + + /** + * The reason why the name is not available. 'Invalid' indicates the name + * provided does not match the naming requirements (incorrect length, + * unsupported characters, etc.). 'AlreadyExists' indicates that the name + * is already in use and is therefore unavailable. Possible values include: + * 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private UnavailableNameReason reason; + + /** + * A message that explains why the name is invalid and provides resource + * naming requirements. Available only if 'Invalid' is returned in the + * 'reason' property. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get a value indicating whether the name is available. + * + * @return the isNameAvailable value + */ + public Boolean isNameAvailable() { + return this.isNameAvailable; + } + + /** + * Get the reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public UnavailableNameReason reason() { + return this.reason; + } + + /** + * Get a message that explains why the name is invalid and provides resource naming requirements. Available only if 'Invalid' is returned in the 'reason' property. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/IdParsingUtils.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..309e2501c025b --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationImpl.java new file mode 100644 index 0000000000000..ec3e3a08844fe --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final SearchManager manager; + OperationImpl(OperationInner inner, SearchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SearchManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationInner.java new file mode 100644 index 0000000000000..dfd312ab12ad4 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a REST API operation. + */ +public class OperationInner { + /** + * The name of the operation. This name is of the form + * {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that describes the operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Get the name of the operation. This name is of the form {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that describes the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..fa16fde7a956a --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.search.v2020_03_13.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final SearchManager manager; + + OperationsImpl(SearchManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public SearchManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsInner.java new file mode 100644 index 0000000000000..cb03f299ba78e --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Operations list" }) + @GET("providers/Microsoft.Search/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Search provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl.java new file mode 100644 index 0000000000000..1496f268908fb --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl1.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl1.java new file mode 100644 index 0000000000000..08dd6dfcc0197 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..a56b479a66135 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import java.util.UUID; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnectionProperties; +import rx.functions.Func1; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Update { + private final SearchManager manager; + private String resourceGroupName; + private String searchServiceName; + private String privateEndpointConnectionName; + private SearchManagementRequestOptions usearchManagementRequestOptions; + + PrivateEndpointConnectionImpl(String name, SearchManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, SearchManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.searchServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "searchServices"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + @Override + public SearchManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.updateAsync(this.resourceGroupName, this.searchServiceName, this.privateEndpointConnectionName, this.inner(), this.usearchManagementRequestOptions) + .map(new Func1() { + @Override + public PrivateEndpointConnectionInner call(PrivateEndpointConnectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.searchServiceName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpointConnectionProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { + this.usearchManagementRequestOptions = searchManagementRequestOptions; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..1d4ead1e06675 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an existing Private Endpoint connection to the Azure Cognitive + * Search service. + */ +public class PrivateEndpointConnectionInner { + /** + * The ID of the private endpoint connection. This can be used with the + * Azure Resource Manager to link resources together. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the private endpoint connection. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Describes the properties of an existing Private Endpoint connection to + * the Azure Cognitive Search service. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** + * Get the ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the private endpoint connection. This can be used with the Azure Resource Manager to link resources together. + * + * @param id the id value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the private endpoint connection. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. + * + * @return the properties value + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. + * + * @param properties the properties value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..f597da3b8e121 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final SearchManager manager; + + PrivateEndpointConnectionsImpl(SearchManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public SearchManager manager() { + return this.manager; + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + @Override + public Observable listByServiceAsync(final String resourceGroupName, final String searchServiceName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listByServiceAsync(resourceGroupName, searchServiceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 0000000000000..82fc411c41139 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,1153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections listByService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections") + Observable> listByService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections listByServiceNext" }) + @GET + Observable> listByServiceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner update(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().single().body(); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(privateEndpointConnection); + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.update(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner update(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection, searchManagementRequestOptions), serviceCallback); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable updateAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, privateEndpointConnection, searchManagementRequestOptions).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Private Endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param privateEndpointConnection The definition of the private endpoint connection to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(privateEndpointConnection); + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.update(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), privateEndpointConnection, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.get(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, searchManagementRequestOptions).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of the private endpoint connection to the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.get(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner delete(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.delete(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner delete(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, privateEndpointConnectionName, searchManagementRequestOptions).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disconnects the private endpoint connection and deletes it from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.delete(resourceGroupName, searchServiceName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByService(final String resourceGroupName, final String searchServiceName) { + ServiceResponse> response = listByServiceSinglePageAsync(resourceGroupName, searchServiceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceAsync(final String resourceGroupName, final String searchServiceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceSinglePageAsync(resourceGroupName, searchServiceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByServiceAsync(final String resourceGroupName, final String searchServiceName) { + return listByServiceWithServiceResponseAsync(resourceGroupName, searchServiceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServiceWithServiceResponseAsync(final String resourceGroupName, final String searchServiceName) { + return listByServiceSinglePageAsync(resourceGroupName, searchServiceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceSinglePageAsync(final String resourceGroupName, final String searchServiceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.listByService(this.client.subscriptionId(), resourceGroupName, searchServiceName, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByService(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listByServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByServiceAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServiceWithServiceResponseAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceSinglePageAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.listByService(this.client.subscriptionId(), resourceGroupName, searchServiceName, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByServiceNext(final String nextPageLink) { + ServiceResponse> response = listByServiceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByServiceNextAsync(final String nextPageLink) { + return listByServiceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServiceNextWithServiceResponseAsync(final String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + String nextUrl = String.format("%s", nextPageLink); + return service.listByServiceNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByServiceNext(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByServiceNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServiceNextWithServiceResponseAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all private endpoint connections in the given service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceNextSinglePageAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServiceNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..d27b0ae3668a4 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResourceProperties; + +class PrivateLinkResourceImpl extends WrapperImpl implements PrivateLinkResource { + private final SearchManager manager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, SearchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SearchManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateLinkResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..3659095f33d8d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a supported private link resource for the Azure Cognitive Search + * service. + */ +public class PrivateLinkResourceInner { + /** + * The ID of the private link resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the private link resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Describes the properties of a supported private link resource for the + * Azure Cognitive Search service. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private PrivateLinkResourceProperties properties; + + /** + * Get the ID of the private link resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the private link resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get describes the properties of a supported private link resource for the Azure Cognitive Search service. + * + * @return the properties value + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..38df126867594 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResources; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResource; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final SearchManager manager; + + PrivateLinkResourcesImpl(SearchManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public SearchManager manager() { + return this.manager; + } + + private PrivateLinkResourceImpl wrapModel(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + + @Override + public Observable listSupportedAsync(String resourceGroupName, String searchServiceName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listSupportedAsync(resourceGroupName, searchServiceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 0000000000000..e95e9ccb5b56d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,250 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResources listSupported" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources") + Observable> listSupported(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PrivateLinkResourceInner> object if successful. + */ + public List listSupported(String resourceGroupName, String searchServiceName) { + return listSupportedWithServiceResponseAsync(resourceGroupName, searchServiceName).toBlocking().single().body(); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSupportedAsync(String resourceGroupName, String searchServiceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSupportedWithServiceResponseAsync(resourceGroupName, searchServiceName), serviceCallback); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateLinkResourceInner> object + */ + public Observable> listSupportedAsync(String resourceGroupName, String searchServiceName) { + return listSupportedWithServiceResponseAsync(resourceGroupName, searchServiceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateLinkResourceInner> object + */ + public Observable>> listSupportedWithServiceResponseAsync(String resourceGroupName, String searchServiceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.listSupported(this.client.subscriptionId(), resourceGroupName, searchServiceName, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSupportedDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PrivateLinkResourceInner> object if successful. + */ + public List listSupported(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return listSupportedWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSupportedAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSupportedWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateLinkResourceInner> object + */ + public Observable> listSupportedAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return listSupportedWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all supported private link resource types for the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateLinkResourceInner> object + */ + public Observable>> listSupportedWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.listSupported(this.client.subscriptionId(), resourceGroupName, searchServiceName, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSupportedDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSupportedDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyImpl.java new file mode 100644 index 0000000000000..cdbcf44826c95 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.QueryKey; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class QueryKeyImpl extends WrapperImpl implements QueryKey { + private final SearchManager manager; + QueryKeyImpl(QueryKeyInner inner, SearchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SearchManager manager() { + return this.manager; + } + + @Override + public String keyVal() { + return this.inner().key(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyInner.java new file mode 100644 index 0000000000000..4a33266cf56d1 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeyInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an API key for a given Azure Cognitive Search service that has + * permissions for query operations only. + */ +public class QueryKeyInner { + /** + * The name of the query API key; may be empty. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The value of the query API key. + */ + @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /** + * Get the name of the query API key; may be empty. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the value of the query API key. + * + * @return the key value + */ + public String key() { + return this.key; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysImpl.java new file mode 100644 index 0000000000000..827694a491724 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.QueryKeys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.search.v2020_03_13.QueryKey; + +class QueryKeysImpl extends WrapperImpl implements QueryKeys { + private final SearchManager manager; + + QueryKeysImpl(SearchManager manager) { + super(manager.inner().queryKeys()); + this.manager = manager; + } + + public SearchManager manager() { + return this.manager; + } + + @Override + public Observable createAsync(String resourceGroupName, String searchServiceName, String name) { + QueryKeysInner client = this.inner(); + return client.createAsync(resourceGroupName, searchServiceName, name) + .map(new Func1() { + @Override + public QueryKey call(QueryKeyInner inner) { + return new QueryKeyImpl(inner, manager()); + } + }); + } + + @Override + public Observable listBySearchServiceAsync(final String resourceGroupName, final String searchServiceName) { + QueryKeysInner client = this.inner(); + return client.listBySearchServiceAsync(resourceGroupName, searchServiceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public QueryKey call(QueryKeyInner inner) { + return new QueryKeyImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String searchServiceName, String key) { + QueryKeysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, searchServiceName, key).toCompletable(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysInner.java new file mode 100644 index 0000000000000..ae8111ccc23c3 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/QueryKeysInner.java @@ -0,0 +1,941 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in QueryKeys. + */ +public class QueryKeysInner { + /** The Retrofit service to perform REST calls. */ + private QueryKeysService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of QueryKeysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueryKeysInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(QueryKeysService.class); + this.client = client; + } + + /** + * The interface defining all the services for QueryKeys to be + * used by Retrofit to perform actually REST calls. + */ + interface QueryKeysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.QueryKeys create" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/createQueryKey/{name}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.QueryKeys listBySearchService" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys") + Observable> listBySearchService(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.QueryKeys delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/deleteQueryKey/{key}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("key") String key, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.QueryKeys listBySearchServiceNext" }) + @GET + Observable> listBySearchServiceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryKeyInner object if successful. + */ + public QueryKeyInner create(String resourceGroupName, String searchServiceName, String name) { + return createWithServiceResponseAsync(resourceGroupName, searchServiceName, name).toBlocking().single().body(); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String searchServiceName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, searchServiceName, name), serviceCallback); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryKeyInner object + */ + public Observable createAsync(String resourceGroupName, String searchServiceName, String name) { + return createWithServiceResponseAsync(resourceGroupName, searchServiceName, name).map(new Func1, QueryKeyInner>() { + @Override + public QueryKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryKeyInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.create(resourceGroupName, searchServiceName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryKeyInner object if successful. + */ + public QueryKeyInner create(String resourceGroupName, String searchServiceName, String name, SearchManagementRequestOptions searchManagementRequestOptions) { + return createWithServiceResponseAsync(resourceGroupName, searchServiceName, name, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String searchServiceName, String name, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, searchServiceName, name, searchManagementRequestOptions), serviceCallback); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryKeyInner object + */ + public Observable createAsync(String resourceGroupName, String searchServiceName, String name, SearchManagementRequestOptions searchManagementRequestOptions) { + return createWithServiceResponseAsync(resourceGroupName, searchServiceName, name, searchManagementRequestOptions).map(new Func1, QueryKeyInner>() { + @Override + public QueryKeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generates a new query key for the specified Search service. You can create up to 50 query keys per service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param name The name of the new query API key. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryKeyInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String name, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.create(resourceGroupName, searchServiceName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryKeyInner> object if successful. + */ + public PagedList listBySearchService(final String resourceGroupName, final String searchServiceName) { + ServiceResponse> response = listBySearchServiceSinglePageAsync(resourceGroupName, searchServiceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySearchServiceAsync(final String resourceGroupName, final String searchServiceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySearchServiceSinglePageAsync(resourceGroupName, searchServiceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable> listBySearchServiceAsync(final String resourceGroupName, final String searchServiceName) { + return listBySearchServiceWithServiceResponseAsync(resourceGroupName, searchServiceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable>> listBySearchServiceWithServiceResponseAsync(final String resourceGroupName, final String searchServiceName) { + return listBySearchServiceSinglePageAsync(resourceGroupName, searchServiceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySearchServiceNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySearchServiceSinglePageAsync(final String resourceGroupName, final String searchServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.listBySearchService(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySearchServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryKeyInner> object if successful. + */ + public PagedList listBySearchService(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listBySearchServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySearchServiceAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySearchServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable> listBySearchServiceAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listBySearchServiceWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable>> listBySearchServiceWithServiceResponseAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listBySearchServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySearchServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySearchServiceSinglePageAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.listBySearchService(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySearchServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySearchServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String searchServiceName, String key) { + deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, key).toBlocking().single().body(); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, String key, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, key), serviceCallback); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, String key) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, key).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String key) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (key == null) { + throw new IllegalArgumentException("Parameter key is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.delete(resourceGroupName, searchServiceName, key, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String searchServiceName, String key, SearchManagementRequestOptions searchManagementRequestOptions) { + deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, key, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, String key, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, key, searchManagementRequestOptions), serviceCallback); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, String key, SearchManagementRequestOptions searchManagementRequestOptions) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, key, searchManagementRequestOptions).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param key The query key to be deleted. Query keys are identified by value, not by name. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String key, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (key == null) { + throw new IllegalArgumentException("Parameter key is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.delete(resourceGroupName, searchServiceName, key, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryKeyInner> object if successful. + */ + public PagedList listBySearchServiceNext(final String nextPageLink) { + ServiceResponse> response = listBySearchServiceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySearchServiceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySearchServiceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable> listBySearchServiceNextAsync(final String nextPageLink) { + return listBySearchServiceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable>> listBySearchServiceNextWithServiceResponseAsync(final String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySearchServiceNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySearchServiceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + String nextUrl = String.format("%s", nextPageLink); + return service.listBySearchServiceNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySearchServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryKeyInner> object if successful. + */ + public PagedList listBySearchServiceNext(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySearchServiceNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable> listBySearchServiceNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listBySearchServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryKeyInner> object + */ + public Observable>> listBySearchServiceNextWithServiceResponseAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listBySearchServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySearchServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Cognitive Search service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryKeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySearchServiceNextSinglePageAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listBySearchServiceNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySearchServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySearchServiceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManagementClientImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManagementClientImpl.java new file mode 100644 index 0000000000000..64cbd198768e2 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManagementClientImpl.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the SearchManagementClientImpl class. + */ +public class SearchManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. */ + private String subscriptionId; + + /** + * Gets The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public SearchManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for each request. The current version is 2019-10-01-Preview. */ + private String apiVersion; + + /** + * Gets The API version to use for each request. The current version is 2019-10-01-Preview. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public SearchManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public SearchManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public SearchManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The AdminKeysInner object to access its operations. + */ + private AdminKeysInner adminKeys; + + /** + * Gets the AdminKeysInner object to access its operations. + * @return the AdminKeysInner object. + */ + public AdminKeysInner adminKeys() { + return this.adminKeys; + } + + /** + * The QueryKeysInner object to access its operations. + */ + private QueryKeysInner queryKeys; + + /** + * Gets the QueryKeysInner object to access its operations. + * @return the QueryKeysInner object. + */ + public QueryKeysInner queryKeys() { + return this.queryKeys; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The SharedPrivateLinkResourcesInner object to access its operations. + */ + private SharedPrivateLinkResourcesInner sharedPrivateLinkResources; + + /** + * Gets the SharedPrivateLinkResourcesInner object to access its operations. + * @return the SharedPrivateLinkResourcesInner object. + */ + public SharedPrivateLinkResourcesInner sharedPrivateLinkResources() { + return this.sharedPrivateLinkResources; + } + + /** + * Initializes an instance of SearchManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public SearchManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of SearchManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public SearchManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of SearchManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public SearchManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-03-13"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.adminKeys = new AdminKeysInner(restClient().retrofit(), this); + this.queryKeys = new QueryKeysInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.sharedPrivateLinkResources = new SharedPrivateLinkResourcesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "SearchManagementClient", "2020-03-13"); + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManager.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManager.java new file mode 100644 index 0000000000000..5683c5c13b988 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.search.v2020_03_13.Operations; +import com.microsoft.azure.management.search.v2020_03_13.AdminKeys; +import com.microsoft.azure.management.search.v2020_03_13.QueryKeys; +import com.microsoft.azure.management.search.v2020_03_13.Services; +import com.microsoft.azure.management.search.v2020_03_13.PrivateLinkResources; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnections; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Search resource management. + */ +public final class SearchManager extends ManagerCore { + private Operations operations; + private AdminKeys adminKeys; + private QueryKeys queryKeys; + private Services services; + private PrivateLinkResources privateLinkResources; + private PrivateEndpointConnections privateEndpointConnections; + private SharedPrivateLinkResources sharedPrivateLinkResources; + /** + * Get a Configurable instance that can be used to create SearchManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new SearchManager.ConfigurableImpl(); + } + /** + * Creates an instance of SearchManager that exposes Search resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the SearchManager + */ + public static SearchManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new SearchManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of SearchManager that exposes Search resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the SearchManager + */ + public static SearchManager authenticate(RestClient restClient, String subscriptionId) { + return new SearchManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of SearchManager that exposes Search management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Search management API entry points that work across subscriptions + */ + SearchManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage AdminKeys. + */ + public AdminKeys adminKeys() { + if (this.adminKeys == null) { + this.adminKeys = new AdminKeysImpl(this); + } + return this.adminKeys; + } + + /** + * @return Entry point to manage QueryKeys. + */ + public QueryKeys queryKeys() { + if (this.queryKeys == null) { + this.queryKeys = new QueryKeysImpl(this); + } + return this.queryKeys; + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage SharedPrivateLinkResources. + */ + public SharedPrivateLinkResources sharedPrivateLinkResources() { + if (this.sharedPrivateLinkResources == null) { + this.sharedPrivateLinkResources = new SharedPrivateLinkResourcesImpl(this); + } + return this.sharedPrivateLinkResources; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public SearchManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return SearchManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private SearchManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new SearchManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceImpl.java new file mode 100644 index 0000000000000..2b986530479c0 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceImpl.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.search.v2020_03_13.SearchService; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import java.util.UUID; +import com.microsoft.azure.management.search.v2020_03_13.Identity; +import com.microsoft.azure.management.search.v2020_03_13.HostingMode; +import com.microsoft.azure.management.search.v2020_03_13.PublicNetworkAccess; +import com.microsoft.azure.management.search.v2020_03_13.SearchServiceStatus; +import com.microsoft.azure.management.search.v2020_03_13.ProvisioningState; +import com.microsoft.azure.management.search.v2020_03_13.NetworkRuleSet; +import java.util.List; +import com.microsoft.azure.management.search.v2020_03_13.Sku; +import java.util.ArrayList; +import com.microsoft.azure.management.search.v2020_03_13.PrivateEndpointConnection; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResource; +import rx.functions.Func1; + +class SearchServiceImpl extends GroupableResourceCoreImpl implements SearchService, SearchService.Definition, SearchService.Update { + private SearchManagementRequestOptions csearchManagementRequestOptions; + private SearchManagementRequestOptions usearchManagementRequestOptions; + SearchServiceImpl(String name, SearchServiceInner inner, SearchManager manager) { + super(name, inner, manager); + this.csearchManagementRequestOptions = new SearchManagementRequestOptions(); + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner(), this.csearchManagementRequestOptions) + .map(new Func1() { + @Override + public SearchServiceInner call(SearchServiceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner(), this.usearchManagementRequestOptions) + .map(new Func1() { + @Override + public SearchServiceInner call(SearchServiceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServicesInner client = this.manager().inner().services(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.csearchManagementRequestOptions = new SearchManagementRequestOptions(); + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + @Override + public HostingMode hostingMode() { + return this.inner().hostingMode(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public NetworkRuleSet networkRuleSet() { + return this.inner().networkRuleSet(); + } + + @Override + public Integer partitionCount() { + return this.inner().partitionCount(); + } + + @Override + public List privateEndpointConnections() { + List lst = new ArrayList(); + if (this.inner().privateEndpointConnections() != null) { + for (PrivateEndpointConnectionInner inner : this.inner().privateEndpointConnections()) { + lst.add( new PrivateEndpointConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.inner().publicNetworkAccess(); + } + + @Override + public Integer replicaCount() { + return this.inner().replicaCount(); + } + + @Override + public List sharedPrivateLinkResources() { + List lst = new ArrayList(); + if (this.inner().sharedPrivateLinkResources() != null) { + for (SharedPrivateLinkResourceInner inner : this.inner().sharedPrivateLinkResources()) { + lst.add( new SharedPrivateLinkResourceImpl(inner, manager())); + } + } + return lst; + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public SearchServiceStatus status() { + return this.inner().status(); + } + + @Override + public String statusDetails() { + return this.inner().statusDetails(); + } + + @Override + public SearchServiceImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { + if (isInCreateMode()) { + this.csearchManagementRequestOptions = searchManagementRequestOptions; + } else { + this.usearchManagementRequestOptions = searchManagementRequestOptions; + } + return this; + } + + @Override + public SearchServiceImpl withHostingMode(HostingMode hostingMode) { + this.inner().withHostingMode(hostingMode); + return this; + } + + @Override + public SearchServiceImpl withIdentity(Identity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public SearchServiceImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.inner().withNetworkRuleSet(networkRuleSet); + return this; + } + + @Override + public SearchServiceImpl withPartitionCount(Integer partitionCount) { + this.inner().withPartitionCount(partitionCount); + return this; + } + + @Override + public SearchServiceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.inner().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + @Override + public SearchServiceImpl withReplicaCount(Integer replicaCount) { + this.inner().withReplicaCount(replicaCount); + return this; + } + + @Override + public SearchServiceImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceInner.java new file mode 100644 index 0000000000000..e4ffcc005547b --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SearchServiceInner.java @@ -0,0 +1,329 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.HostingMode; +import com.microsoft.azure.management.search.v2020_03_13.PublicNetworkAccess; +import com.microsoft.azure.management.search.v2020_03_13.SearchServiceStatus; +import com.microsoft.azure.management.search.v2020_03_13.ProvisioningState; +import com.microsoft.azure.management.search.v2020_03_13.NetworkRuleSet; +import java.util.List; +import com.microsoft.azure.management.search.v2020_03_13.Sku; +import com.microsoft.azure.management.search.v2020_03_13.Identity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Describes an Azure Cognitive Search service and its current state. + */ +@JsonFlatten +@SkipParentValidation +public class SearchServiceInner extends Resource { + /** + * The number of replicas in the Search service. If specified, it must be a + * value between 1 and 12 inclusive for standard SKUs or between 1 and 3 + * inclusive for basic SKU. + */ + @JsonProperty(value = "properties.replicaCount") + private Integer replicaCount; + + /** + * The number of partitions in the Search service; if specified, it can be + * 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard + * SKUs. For 'standard3' services with hostingMode set to 'highDensity', + * the allowed values are between 1 and 3. + */ + @JsonProperty(value = "properties.partitionCount") + private Integer partitionCount; + + /** + * Applicable only for the standard3 SKU. You can set this property to + * enable up to 3 high density partitions that allow up to 1000 indexes, + * which is much higher than the maximum indexes allowed for any other SKU. + * For the standard3 SKU, the value is either 'default' or 'highDensity'. + * For all other SKUs, this value must be 'default'. Possible values + * include: 'default', 'highDensity'. + */ + @JsonProperty(value = "properties.hostingMode") + private HostingMode hostingMode; + + /** + * This value can be set to 'enabled' to avoid breaking changes on existing + * customer resources and templates. If set to 'disabled', traffic over + * public interface is not allowed, and private endpoint connections would + * be the exclusive access method. Possible values include: 'enabled', + * 'disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * The status of the Search service. Possible values include: 'running': + * The Search service is running and no provisioning operations are + * underway. 'provisioning': The Search service is being provisioned or + * scaled up or down. 'deleting': The Search service is being deleted. + * 'degraded': The Search service is degraded. This can occur when the + * underlying search units are not healthy. The Search service is most + * likely operational, but performance might be slow and some requests + * might be dropped. 'disabled': The Search service is disabled. In this + * state, the service will reject all API requests. 'error': The Search + * service is in an error state. If your service is in the degraded, + * disabled, or error states, it means the Azure Cognitive Search team is + * actively investigating the underlying issue. Dedicated services in these + * states are still chargeable based on the number of search units + * provisioned. Possible values include: 'running', 'provisioning', + * 'deleting', 'degraded', 'disabled', 'error'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private SearchServiceStatus status; + + /** + * The details of the Search service status. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * The state of the last provisioning operation performed on the Search + * service. Provisioning is an intermediate state that occurs while service + * capacity is being established. After capacity is set up, + * provisioningState changes to either 'succeeded' or 'failed'. Client + * applications can poll provisioning status (the recommended polling + * interval is from 30 seconds to one minute) by using the Get Search + * Service operation to see when an operation is completed. If you are + * using the free service, this value tends to come back as 'succeeded' + * directly in the call to Create Search service. This is because the free + * service uses capacity that is already set up. Possible values include: + * 'succeeded', 'provisioning', 'failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Network specific rules that determine how the Azure Cognitive Search + * service may be reached. + */ + @JsonProperty(value = "properties.networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /** + * The list of private endpoint connections to the Azure Cognitive Search + * service. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * The list of shared private link resources managed by the Azure Cognitive + * Search service. + */ + @JsonProperty(value = "properties.sharedPrivateLinkResources", access = JsonProperty.Access.WRITE_ONLY) + private List sharedPrivateLinkResources; + + /** + * The SKU of the Search Service, which determines price tier and capacity + * limits. This property is required when creating a new Search Service. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Get the number of replicas in the Search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU. + * + * @return the replicaCount value + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the number of replicas in the Search service. If specified, it must be a value between 1 and 12 inclusive for standard SKUs or between 1 and 3 inclusive for basic SKU. + * + * @param replicaCount the replicaCount value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get the number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. + * + * @return the partitionCount value + */ + public Integer partitionCount() { + return this.partitionCount; + } + + /** + * Set the number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. + * + * @param partitionCount the partitionCount value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withPartitionCount(Integer partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. Possible values include: 'default', 'highDensity'. + * + * @return the hostingMode value + */ + public HostingMode hostingMode() { + return this.hostingMode; + } + + /** + * Set applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. Possible values include: 'default', 'highDensity'. + * + * @param hostingMode the hostingMode value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withHostingMode(HostingMode hostingMode) { + this.hostingMode = hostingMode; + return this; + } + + /** + * Get this value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. Possible values include: 'enabled', 'disabled'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set this value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. Possible values include: 'enabled', 'disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the status of the Search service. Possible values include: 'running': The Search service is running and no provisioning operations are underway. 'provisioning': The Search service is being provisioned or scaled up or down. 'deleting': The Search service is being deleted. 'degraded': The Search service is degraded. This can occur when the underlying search units are not healthy. The Search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The Search service is disabled. In this state, the service will reject all API requests. 'error': The Search service is in an error state. If your service is in the degraded, disabled, or error states, it means the Azure Cognitive Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. Possible values include: 'running', 'provisioning', 'deleting', 'degraded', 'disabled', 'error'. + * + * @return the status value + */ + public SearchServiceStatus status() { + return this.status; + } + + /** + * Get the details of the Search service status. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the state of the last provisioning operation performed on the Search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'succeeded' directly in the call to Create Search service. This is because the free service uses capacity that is already set up. Possible values include: 'succeeded', 'provisioning', 'failed'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get network specific rules that determine how the Azure Cognitive Search service may be reached. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network specific rules that determine how the Azure Cognitive Search service may be reached. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the list of private endpoint connections to the Azure Cognitive Search service. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the list of shared private link resources managed by the Azure Cognitive Search service. + * + * @return the sharedPrivateLinkResources value + */ + public List sharedPrivateLinkResources() { + return this.sharedPrivateLinkResources; + } + + /** + * Get the SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service. + * + * @param sku the sku value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the SearchServiceInner object itself. + */ + public SearchServiceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..bbef4dd55a650 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.search.v2020_03_13.Services; +import com.microsoft.azure.management.search.v2020_03_13.SearchService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.search.v2020_03_13.CheckNameAvailabilityOutput; + +class ServicesImpl extends GroupableResourcesCoreImpl implements Services { + protected ServicesImpl(SearchManager manager) { + super(manager.inner().services(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SearchService call(SearchServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SearchService call(SearchServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public SearchServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + ServicesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public CheckNameAvailabilityOutput call(CheckNameAvailabilityOutputInner inner) { + return new CheckNameAvailabilityOutputImpl(inner, manager()); + } + }); + } + + @Override + protected SearchServiceImpl wrapModel(SearchServiceInner inner) { + return new SearchServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected SearchServiceImpl wrapModel(String name) { + return new SearchServiceImpl(name, new SearchServiceInner(), this.manager()); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesInner.java new file mode 100644 index 0000000000000..1dde49f7bfcea --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/ServicesInner.java @@ -0,0 +1,2089 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.search.v2020_03_13.CheckNameAvailabilityInput; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Body SearchServiceInner service, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Body SearchServiceInner service, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Body SearchServiceInner service, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Body CheckNameAvailabilityInput checkNameAvailabilityInput, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.Services listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner createOrUpdate(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service).toBlocking().last().body(); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service), serviceCallback); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (service == null) { + throw new IllegalArgumentException("Parameter service is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(service); + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + Observable> observable = service.createOrUpdate(resourceGroupName, searchServiceName, this.client.subscriptionId(), service, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner createOrUpdate(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions).toBlocking().last().body(); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions), serviceCallback); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (service == null) { + throw new IllegalArgumentException("Parameter service is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(service); + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + Observable> observable = service.createOrUpdate(resourceGroupName, searchServiceName, this.client.subscriptionId(), service, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner beginCreateOrUpdate(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service).toBlocking().single().body(); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service), serviceCallback); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (service == null) { + throw new IllegalArgumentException("Parameter service is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(service); + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.beginCreateOrUpdate(resourceGroupName, searchServiceName, this.client.subscriptionId(), service, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner beginCreateOrUpdate(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions), serviceCallback); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + * @param service The definition of the Search service to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (service == null) { + throw new IllegalArgumentException("Parameter service is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(service); + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.beginCreateOrUpdate(resourceGroupName, searchServiceName, this.client.subscriptionId(), service, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner update(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, service).toBlocking().single().body(); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, service), serviceCallback); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, service).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (service == null) { + throw new IllegalArgumentException("Parameter service is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(service); + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.update(resourceGroupName, searchServiceName, this.client.subscriptionId(), service, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner update(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions), serviceCallback); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + return updateWithServiceResponseAsync(resourceGroupName, searchServiceName, service, searchManagementRequestOptions).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service to update. + * @param service The definition of the Search service to update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchServiceInner service, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (service == null) { + throw new IllegalArgumentException("Parameter service is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(service); + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.update(resourceGroupName, searchServiceName, this.client.subscriptionId(), service, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner getByResourceGroup(String resourceGroupName, String searchServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, searchServiceName).toBlocking().single().body(); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String searchServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, searchServiceName), serviceCallback); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String searchServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, searchServiceName).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String searchServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.getByResourceGroup(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchServiceInner object if successful. + */ + public SearchServiceInner getByResourceGroup(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).map(new Func1, SearchServiceInner>() { + @Override + public SearchServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Search service with the given name in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.getByResourceGroup(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String searchServiceName) { + deleteWithServiceResponseAsync(resourceGroupName, searchServiceName).toBlocking().single().body(); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName), serviceCallback); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.delete(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.delete(resourceGroupName, searchServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final SearchManagementRequestOptions searchManagementRequestOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByResourceGroupSinglePageAsync(resourceGroupName, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList list(final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listSinglePageAsync(searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final SearchManagementRequestOptions searchManagementRequestOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listAsync(final SearchManagementRequestOptions searchManagementRequestOptions) { + return listWithServiceResponseAsync(searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listWithServiceResponseAsync(final SearchManagementRequestOptions searchManagementRequestOptions) { + return listSinglePageAsync(searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final SearchManagementRequestOptions searchManagementRequestOptions) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityOutputInner object if successful. + */ + public CheckNameAvailabilityOutputInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityOutputInner>() { + @Override + public CheckNameAvailabilityOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + CheckNameAvailabilityInput checkNameAvailabilityInput = new CheckNameAvailabilityInput(); + checkNameAvailabilityInput.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, checkNameAvailabilityInput, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityOutputInner object if successful. + */ + public CheckNameAvailabilityOutputInner checkNameAvailability(String name, SearchManagementRequestOptions searchManagementRequestOptions) { + return checkNameAvailabilityWithServiceResponseAsync(name, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name, searchManagementRequestOptions), serviceCallback); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable checkNameAvailabilityAsync(String name, SearchManagementRequestOptions searchManagementRequestOptions) { + return checkNameAvailabilityWithServiceResponseAsync(name, searchManagementRequestOptions).map(new Func1, CheckNameAvailabilityOutputInner>() { + @Override + public CheckNameAvailabilityOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether or not the given Search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). + * + * @param name The Search service name to validate. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name, SearchManagementRequestOptions searchManagementRequestOptions) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + CheckNameAvailabilityInput checkNameAvailabilityInput = new CheckNameAvailabilityInput(); + checkNameAvailabilityInput.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, checkNameAvailabilityInput, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByResourceGroupNextSinglePageAsync(nextPageLink, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all Search services in the given resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SearchServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SearchServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listNextSinglePageAsync(nextPageLink, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all Search services in the given subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SearchServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..ce9f098ee460d --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceImpl.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import java.util.UUID; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResourceProperties; +import rx.functions.Func1; + +class SharedPrivateLinkResourceImpl extends CreatableUpdatableImpl implements SharedPrivateLinkResource, SharedPrivateLinkResource.Definition { + private final SearchManager manager; + private String resourceGroupName; + private String searchServiceName; + private String sharedPrivateLinkResourceName; + private SearchManagementRequestOptions csearchManagementRequestOptions; + private SearchManagementRequestOptions usearchManagementRequestOptions; + + SharedPrivateLinkResourceImpl(String name, SearchManager manager) { + super(name, new SharedPrivateLinkResourceInner()); + this.manager = manager; + // Set resource name + this.sharedPrivateLinkResourceName = name; + // + this.csearchManagementRequestOptions = new SearchManagementRequestOptions(); + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + SharedPrivateLinkResourceImpl(SharedPrivateLinkResourceInner inner, SearchManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.sharedPrivateLinkResourceName = inner.name(); + // + this.csearchManagementRequestOptions = new SearchManagementRequestOptions(); + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + @Override + public SearchManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SharedPrivateLinkResourcesInner client = this.manager().inner().sharedPrivateLinkResources(); + return client.createOrUpdateAsync(this.resourceGroupName, this.searchServiceName, this.sharedPrivateLinkResourceName, this.inner(), this.csearchManagementRequestOptions) + .map(new Func1() { + @Override + public SharedPrivateLinkResourceInner call(SharedPrivateLinkResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SharedPrivateLinkResourcesInner client = this.manager().inner().sharedPrivateLinkResources(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + SharedPrivateLinkResourcesInner client = this.manager().inner().sharedPrivateLinkResources(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + // This is a create-only resource + return true; + } + + private void resetCreateUpdateParameters() { + this.csearchManagementRequestOptions = new SearchManagementRequestOptions(); + this.usearchManagementRequestOptions = new SearchManagementRequestOptions(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SharedPrivateLinkResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public SharedPrivateLinkResourceImpl withExistingSearchService(String resourceGroupName, String searchServiceName) { + this.resourceGroupName = resourceGroupName; + this.searchServiceName = searchServiceName; + return this; + } + + @Override + public SharedPrivateLinkResourceImpl withSearchManagementRequestOptions(SearchManagementRequestOptions searchManagementRequestOptions) { + this.csearchManagementRequestOptions = searchManagementRequestOptions; + return this; + } + + @Override + public SharedPrivateLinkResourceImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public SharedPrivateLinkResourceImpl withProperties(SharedPrivateLinkResourceProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java new file mode 100644 index 0000000000000..e33f211abd6cd --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourceInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a Shared Private Link Resource managed by the Azure Cognitive + * Search service. + */ +public class SharedPrivateLinkResourceInner { + /** + * The name of the shared private link resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Describes the properties of a Shared Private Link Resource managed by + * the Azure Cognitive Search service. + */ + @JsonProperty(value = "properties") + private SharedPrivateLinkResourceProperties properties; + + /** + * Get the name of the shared private link resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the shared private link resource. + * + * @param name the name value to set + * @return the SharedPrivateLinkResourceInner object itself. + */ + public SharedPrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. + * + * @return the properties value + */ + public SharedPrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Set describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. + * + * @param properties the properties value to set + * @return the SharedPrivateLinkResourceInner object itself. + */ + public SharedPrivateLinkResourceInner withProperties(SharedPrivateLinkResourceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesImpl.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..a8179dae347bc --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResource; + +class SharedPrivateLinkResourcesImpl extends WrapperImpl implements SharedPrivateLinkResources { + private final SearchManager manager; + + SharedPrivateLinkResourcesImpl(SearchManager manager) { + super(manager.inner().sharedPrivateLinkResources()); + this.manager = manager; + } + + public SearchManager manager() { + return this.manager; + } + + @Override + public SharedPrivateLinkResourceImpl define(String name) { + return wrapModel(name); + } + + private SharedPrivateLinkResourceImpl wrapModel(SharedPrivateLinkResourceInner inner) { + return new SharedPrivateLinkResourceImpl(inner, manager()); + } + + private SharedPrivateLinkResourceImpl wrapModel(String name) { + return new SharedPrivateLinkResourceImpl(name, this.manager()); + } + + @Override + public Observable listByServiceAsync(final String resourceGroupName, final String searchServiceName) { + SharedPrivateLinkResourcesInner client = this.inner(); + return client.listByServiceAsync(resourceGroupName, searchServiceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SharedPrivateLinkResource call(SharedPrivateLinkResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + SharedPrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName) + .flatMap(new Func1>() { + @Override + public Observable call(SharedPrivateLinkResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SharedPrivateLinkResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + SharedPrivateLinkResourcesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).toCompletable(); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java new file mode 100644 index 0000000000000..d9084fec320b8 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/SharedPrivateLinkResourcesInner.java @@ -0,0 +1,1152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.search.v2020_03_13.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.search.v2020_03_13.SearchManagementRequestOptions; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SharedPrivateLinkResources. + */ +public class SharedPrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private SharedPrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private SearchManagementClientImpl client; + + /** + * Initializes an instance of SharedPrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SharedPrivateLinkResourcesInner(Retrofit retrofit, SearchManagementClientImpl client) { + this.service = retrofit.create(SharedPrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SharedPrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface SharedPrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @Path("subscriptionId") String subscriptionId, @Body SharedPrivateLinkResourceInner sharedPrivateLinkResource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Path("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources listByService" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources") + Observable> listByService(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("searchServiceName") String searchServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.search.v2020_03_13.SharedPrivateLinkResources listByServiceNext" }) + @GET + Observable> listByServiceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("x-ms-client-request-id") UUID clientRequestId, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedPrivateLinkResourceInner object if successful. + */ + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource).toBlocking().single().body(); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource), serviceCallback); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource).map(new Func1, SharedPrivateLinkResourceInner>() { + @Override + public SharedPrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (sharedPrivateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (sharedPrivateLinkResource == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResource is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(sharedPrivateLinkResource); + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.createOrUpdate(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), sharedPrivateLinkResource, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedPrivateLinkResourceInner object if successful. + */ + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, searchManagementRequestOptions), serviceCallback); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, sharedPrivateLinkResource, searchManagementRequestOptions).map(new Func1, SharedPrivateLinkResourceInner>() { + @Override + public SharedPrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param sharedPrivateLinkResource The definition of the shared private link resource to create or update. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner sharedPrivateLinkResource, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (sharedPrivateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (sharedPrivateLinkResource == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResource is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(sharedPrivateLinkResource); + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.createOrUpdate(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), sharedPrivateLinkResource, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedPrivateLinkResourceInner object if successful. + */ + public SharedPrivateLinkResourceInner get(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).toBlocking().single().body(); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName), serviceCallback); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable getAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).map(new Func1, SharedPrivateLinkResourceInner>() { + @Override + public SharedPrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (sharedPrivateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.get(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedPrivateLinkResourceInner object if successful. + */ + public SharedPrivateLinkResourceInner get(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable getAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return getWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, searchManagementRequestOptions).map(new Func1, SharedPrivateLinkResourceInner>() { + @Override + public SharedPrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of the shared private link resource managed by the Search service in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedPrivateLinkResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (sharedPrivateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.get(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).toBlocking().single().body(); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName), serviceCallback); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (sharedPrivateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.delete(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions) { + deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, searchManagementRequestOptions).toBlocking().single().body(); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, searchManagementRequestOptions), serviceCallback); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions) { + return deleteWithServiceResponseAsync(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, searchManagementRequestOptions).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the shared private link resource from the Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String searchServiceName, String sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (sharedPrivateLinkResourceName == null) { + throw new IllegalArgumentException("Parameter sharedPrivateLinkResourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.delete(resourceGroupName, searchServiceName, sharedPrivateLinkResourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedPrivateLinkResourceInner> object if successful. + */ + public PagedList listByService(final String resourceGroupName, final String searchServiceName) { + ServiceResponse> response = listByServiceSinglePageAsync(resourceGroupName, searchServiceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceAsync(final String resourceGroupName, final String searchServiceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceSinglePageAsync(resourceGroupName, searchServiceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable> listByServiceAsync(final String resourceGroupName, final String searchServiceName) { + return listByServiceWithServiceResponseAsync(resourceGroupName, searchServiceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable>> listByServiceWithServiceResponseAsync(final String resourceGroupName, final String searchServiceName) { + return listByServiceSinglePageAsync(resourceGroupName, searchServiceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedPrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceSinglePageAsync(final String resourceGroupName, final String searchServiceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + return service.listByService(this.client.subscriptionId(), resourceGroupName, searchServiceName, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedPrivateLinkResourceInner> object if successful. + */ + public PagedList listByService(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listByServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable> listByServiceAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceWithServiceResponseAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable>> listByServiceWithServiceResponseAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceSinglePageAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param searchServiceName The name of the Azure Cognitive Search service associated with the specified resource group. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedPrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceSinglePageAsync(final String resourceGroupName, final String searchServiceName, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (searchServiceName == null) { + throw new IllegalArgumentException("Parameter searchServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + return service.listByService(this.client.subscriptionId(), resourceGroupName, searchServiceName, this.client.apiVersion(), this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedPrivateLinkResourceInner> object if successful. + */ + public PagedList listByServiceNext(final String nextPageLink) { + ServiceResponse> response = listByServiceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, null); + } + }, + serviceCallback); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable> listByServiceNextAsync(final String nextPageLink) { + return listByServiceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable>> listByServiceNextWithServiceResponseAsync(final String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, null)); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedPrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final SearchManagementRequestOptions searchManagementRequestOptions = null; + UUID clientRequestId = null; + String nextUrl = String.format("%s", nextPageLink); + return service.listByServiceNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SharedPrivateLinkResourceInner> object if successful. + */ + public PagedList listByServiceNext(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + ServiceResponse> response = listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServiceNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions); + } + }, + serviceCallback); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable> listByServiceNextAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SharedPrivateLinkResourceInner> object + */ + public Observable>> listByServiceNextWithServiceResponseAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + return listByServiceNextSinglePageAsync(nextPageLink, searchManagementRequestOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServiceNextWithServiceResponseAsync(nextPageLink, searchManagementRequestOptions)); + } + }); + } + + /** + * Gets a list of all shared private link resources managed by the given service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param searchManagementRequestOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SharedPrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceNextSinglePageAsync(final String nextPageLink, final SearchManagementRequestOptions searchManagementRequestOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(searchManagementRequestOptions); + UUID clientRequestId = null; + if (searchManagementRequestOptions != null) { + clientRequestId = searchManagementRequestOptions.clientRequestId(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServiceNext(nextUrl, this.client.acceptLanguage(), clientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/package-info.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/package-info.java new file mode 100644 index 0000000000000..e903f28400e37 --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for SearchManagementClient. + * Client that can be used to manage Azure Cognitive Search services and API keys. + */ +package com.microsoft.azure.management.search.v2020_03_13.implementation; diff --git a/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/package-info.java b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/package-info.java new file mode 100644 index 0000000000000..f1016e7810f8a --- /dev/null +++ b/sdk/search/mgmt-resource-manager/v2020_03_13/src/main/java/com/microsoft/azure/management/search/v2020_03_13/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for SearchManagementClient. + * Client that can be used to manage Azure Cognitive Search services and API keys. + */ +package com.microsoft.azure.management.search.v2020_03_13;