diff --git a/eng/automation/api-specs.yaml b/eng/automation/api-specs.yaml index e1784ce597af..8048adf00211 100644 --- a/eng/automation/api-specs.yaml +++ b/eng/automation/api-specs.yaml @@ -66,6 +66,8 @@ informatica: service: informaticadatamanagement keyvault: suffix: generated +kubernetesconfiguration/Microsoft.KubernetesConfiguration/privateLinkScopes: + service: kubernetesconfigurationprivateli liftrastronomer: service: astro liftrqumulo: diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5c15727540dd..13f955855098 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -483,6 +483,7 @@ com.azure.resourcemanager:azure-resourcemanager-programmableconnectivity;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-dell-storage;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-sitemanager;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mongodbatlas;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-kubernetesconfigurationprivateli;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index a0c18e0cb24e..c477aad33334 100644 --- a/pom.xml +++ b/pom.xml @@ -130,6 +130,7 @@ sdk/iotoperations sdk/keyvault sdk/kubernetesconfiguration + sdk/kubernetesconfigurationprivateli sdk/kusto sdk/labservices sdk/lambdatesthyperexecute diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/CHANGELOG.md b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/CHANGELOG.md new file mode 100644 index 000000000000..fde8576788e2 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-05-12) + +- Azure Resource Manager PrivateLinkScopes client library for Java. This package contains Microsoft Azure SDK for PrivateLinkScopes Management SDK. PrivateLinkScopes Client. Package tag package-preview-2024-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-kubernetesconfigurationprivateli Java SDK. diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/README.md b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/README.md new file mode 100644 index 000000000000..59c662d2ad24 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager PrivateLinkScopes client library for Java + +Azure Resource Manager PrivateLinkScopes client library for Java. + +This package contains Microsoft Azure SDK for PrivateLinkScopes Management SDK. PrivateLinkScopes Client. Package tag package-preview-2024-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-kubernetesconfigurationprivateli;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-kubernetesconfigurationprivateli + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +PrivateLinkScopesManager manager = PrivateLinkScopesManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/SAMPLE.md b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/SAMPLE.md new file mode 100644 index 000000000000..1d2744569c73 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/SAMPLE.md @@ -0,0 +1,393 @@ +# Code snippets and samples + + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByPrivateLinkScope](#privateendpointconnections_listbyprivatelinkscope) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByPrivateLinkScope](#privatelinkresources_listbyprivatelinkscope) + +## PrivateLinkScopes + +- [CreateOrUpdate](#privatelinkscopes_createorupdate) +- [Delete](#privatelinkscopes_delete) +- [GetByResourceGroup](#privatelinkscopes_getbyresourcegroup) +- [List](#privatelinkscopes_list) +- [ListByResourceGroup](#privatelinkscopes_listbyresourcegroup) +- [UpdateTags](#privatelinkscopes_updatetags) +### PrivateEndpointConnections_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PrivateLinkScopes CreateOrUpdate. + */ +public final class PrivateLinkScopesCreateOrUpdateSamp { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesCreate.json + */ + /** + * Sample code: PrivateLinkScopeCreate. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeCreate( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesUpdate.json + */ + /** + * Sample code: PrivateLinkScopeUpdate. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeUpdate( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateLinkScopes ListByResourceGroup. + */ +public final class PrivateLinkScopesListByResourceGrou { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesListByResourceGroup.json + */ + /** + * Sample code: PrivateLinkScopeListByResourceGroup. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeListByResourceGroup( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes().listByResourceGroup("my-resource-group", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections ListByPrivateLinkScope. + */ +public final class PrivateEndpointConnectionsListByPri { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a private link scope. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .listByPrivateLinkScopeWithResponse("myResourceGroup", "myPrivateLinkScope", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByPrivateLinkScope + +```java +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkResources() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "KubernetesConfiguration", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +/** + * Samples for PrivateLinkResources ListByPrivateLinkScope. + */ +public final class PrivateLinkResourcesListByPrivateLi { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkResources() + .listByPrivateLinkScopeWithResponse("myResourceGroup", "myPrivateLinkScope", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByPrivateLinkScope + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSam { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .deleteWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkScopes_CreateOrUpdate + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkScopes_Delete + +```java +/** + * Samples for PrivateLinkScopes GetByResourceGroup. + */ +public final class PrivateLinkScopesGetByResourceGroup { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesGet.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkScopes_GetByResourceGroup + +```java +/** + * Samples for PrivateLinkScopes Delete. + */ +public final class PrivateLinkScopesDeleteSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesDelete.json + */ + /** + * Sample code: PrivateLinkScopesDelete. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopesDelete( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .deleteByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkScopes_List + +```java +/** + * Samples for PrivateLinkScopes List. + */ +public final class PrivateLinkScopesListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesList.json + */ + /** + * Sample code: PrivateLinkScopesList.json. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopesListJson( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkScopes_ListByResourceGroup + +```java +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrU { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingPrivateLinkScope("myResourceGroup", "myPrivateLinkScope") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")) + .create(); + } +} +``` + +### PrivateLinkScopes_UpdateTags + +```java +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScope; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PrivateLinkScopes UpdateTags. + */ +public final class PrivateLinkScopesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + */ + /** + * Sample code: PrivateLinkScopeUpdateTagsOnly. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeUpdateTagsOnly( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + KubernetesConfigurationPrivateLinkScope resource = manager.privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/pom.xml b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/pom.xml new file mode 100644 index 000000000000..235589fab076 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-kubernetesconfigurationprivateli + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for PrivateLinkScopes Management + This package contains Microsoft Azure SDK for PrivateLinkScopes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. PrivateLinkScopes Client. Package tag package-preview-2024-11. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/PrivateLinkScopesManager.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/PrivateLinkScopesManager.java new file mode 100644 index 000000000000..ba1f9d4722f7 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/PrivateLinkScopesManager.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkScopesManagementClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateLinkScopesImpl; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateLinkScopesManagementClientBuilder; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnections; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResources; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkScopes; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to PrivateLinkScopesManager. + * PrivateLinkScopes Client. + */ +public final class PrivateLinkScopesManager { + private PrivateLinkScopes privateLinkScopes; + + private PrivateLinkResources privateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + + private final PrivateLinkScopesManagementClient clientObject; + + private PrivateLinkScopesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new PrivateLinkScopesManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of PrivateLinkScopes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PrivateLinkScopes service API instance. + */ + public static PrivateLinkScopesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of PrivateLinkScopes service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the PrivateLinkScopes service API instance. + */ + public static PrivateLinkScopesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new PrivateLinkScopesManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create PrivateLinkScopesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new PrivateLinkScopesManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-kubernetesconfigurationprivateli.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of PrivateLinkScopes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PrivateLinkScopes service API instance. + */ + public PrivateLinkScopesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.kubernetesconfigurationprivateli") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new PrivateLinkScopesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of PrivateLinkScopes. It manages KubernetesConfigurationPrivateLinkScope. + * + * @return Resource collection API of PrivateLinkScopes. + */ + public PrivateLinkScopes privateLinkScopes() { + if (this.privateLinkScopes == null) { + this.privateLinkScopes = new PrivateLinkScopesImpl(clientObject.getPrivateLinkScopes(), this); + } + return privateLinkScopes; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets wrapped service client PrivateLinkScopesManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client PrivateLinkScopesManagementClient. + */ + public PrivateLinkScopesManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateEndpointConnectionsClient.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..e731e5e3232d --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String scopeName, + String privateEndpointConnectionName); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String scopeName, String privateEndpointConnectionName, + Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner listByPrivateLinkScope(String resourceGroupName, String scopeName); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkResourcesClient.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..8a58f18676a7 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String scopeName, String groupName, + Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkScopesClient.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkScopesClient.java new file mode 100644 index 000000000000..0fd33c8d69ed --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkScopesClient.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.TagsResource; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. + */ +public interface PrivateLinkScopesClient { + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String scopeName, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String scopeName, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesConfigurationPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters, Context context); + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesConfigurationPrivateLinkScopeInner createOrUpdate(String resourceGroupName, String scopeName, + KubernetesConfigurationPrivateLinkScopeInner parameters); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String scopeName, TagsResource privateLinkScopeTags, Context context); + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KubernetesConfigurationPrivateLinkScopeInner updateTags(String resourceGroupName, String scopeName, + TagsResource privateLinkScopeTags); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkScopesManagementClient.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkScopesManagementClient.java new file mode 100644 index 000000000000..f75ae72369a1 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/PrivateLinkScopesManagementClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for PrivateLinkScopesManagementClient class. + */ +public interface PrivateLinkScopesManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the PrivateLinkScopesClient object to access its operations. + * + * @return the PrivateLinkScopesClient object. + */ + PrivateLinkScopesClient getPrivateLinkScopes(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/KubernetesConfigurationPrivateLinkScopeInner.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/KubernetesConfigurationPrivateLinkScopeInner.java new file mode 100644 index 000000000000..5309fa9bfe53 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/KubernetesConfigurationPrivateLinkScopeInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScopeProperties; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Arc PrivateLinkScope definition. + */ +@Fluent +public final class KubernetesConfigurationPrivateLinkScopeInner extends Resource { + /* + * Properties that define a Azure Arc PrivateLinkScope resource. + */ + private KubernetesConfigurationPrivateLinkScopeProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of KubernetesConfigurationPrivateLinkScopeInner class. + */ + public KubernetesConfigurationPrivateLinkScopeInner() { + } + + /** + * Get the properties property: Properties that define a Azure Arc PrivateLinkScope resource. + * + * @return the properties value. + */ + public KubernetesConfigurationPrivateLinkScopeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties that define a Azure Arc PrivateLinkScope resource. + * + * @param properties the properties value to set. + * @return the KubernetesConfigurationPrivateLinkScopeInner object itself. + */ + public KubernetesConfigurationPrivateLinkScopeInner + withProperties(KubernetesConfigurationPrivateLinkScopeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public KubernetesConfigurationPrivateLinkScopeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public KubernetesConfigurationPrivateLinkScopeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesConfigurationPrivateLinkScopeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesConfigurationPrivateLinkScopeInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KubernetesConfigurationPrivateLinkScopeInner. + */ + public static KubernetesConfigurationPrivateLinkScopeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesConfigurationPrivateLinkScopeInner deserializedKubernetesConfigurationPrivateLinkScopeInner + = new KubernetesConfigurationPrivateLinkScopeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKubernetesConfigurationPrivateLinkScopeInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeInner.properties + = KubernetesConfigurationPrivateLinkScopeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesConfigurationPrivateLinkScopeInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionInner.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..d5f129c1ca7f --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpoint; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkServiceConnectionState; +import java.io.IOException; + +/** + * The Private Endpoint Connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 000000000000..8f05491e5110 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of private endpoint connection associated with the specified storage account. + */ +@Fluent +public final class PrivateEndpointConnectionListResultInner + implements JsonSerializable { + /* + * Array of private endpoint connections + */ + private List value; + + /** + * Creates an instance of PrivateEndpointConnectionListResultInner class. + */ + public PrivateEndpointConnectionListResultInner() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResultInner object itself. + */ + public PrivateEndpointConnectionListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResultInner. + */ + public static PrivateEndpointConnectionListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResultInner deserializedPrivateEndpointConnectionListResultInner + = new PrivateEndpointConnectionListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResultInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..75804c0b8702 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpoint; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkServiceConnectionState; +import java.io.IOException; + +/** + * Properties of the PrivateEndpointConnectProperties. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The resource of private end point. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceInner.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..5f1fa2d9665d --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A private link resource. + */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 000000000000..b97ae3786dc6 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResultInner implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /** + * Creates an instance of PrivateLinkResourceListResultInner class. + */ + public PrivateLinkResourceListResultInner() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResultInner. + */ + public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner + = new PrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResultInner; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceProperties.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..f0306fb41d36 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Fluent +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/package-info.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/package-info.java new file mode 100644 index 000000000000..83b63672e618 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for PrivateLinkScopesManagementClient. + * PrivateLinkScopes Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/package-info.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/package-info.java new file mode 100644 index 000000000000..a20fa2556217 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for PrivateLinkScopesManagementClient. + * PrivateLinkScopes Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent; diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/KubernetesConfigurationPrivateLinkScopeImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/KubernetesConfigurationPrivateLinkScopeImpl.java new file mode 100644 index 000000000000..89aed6ddeb27 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/KubernetesConfigurationPrivateLinkScopeImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScope; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScopeProperties; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.TagsResource; +import java.util.Collections; +import java.util.Map; + +public final class KubernetesConfigurationPrivateLinkScopeImpl implements KubernetesConfigurationPrivateLinkScope, + KubernetesConfigurationPrivateLinkScope.Definition, KubernetesConfigurationPrivateLinkScope.Update { + private KubernetesConfigurationPrivateLinkScopeInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public KubernetesConfigurationPrivateLinkScopeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public KubernetesConfigurationPrivateLinkScopeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String scopeName; + + private TagsResource updatePrivateLinkScopeTags; + + public KubernetesConfigurationPrivateLinkScopeImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public KubernetesConfigurationPrivateLinkScope create() { + this.innerObject = serviceManager.serviceClient() + .getPrivateLinkScopes() + .createOrUpdateWithResponse(resourceGroupName, scopeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateLinkScopes() + .createOrUpdateWithResponse(resourceGroupName, scopeName, this.innerModel(), context) + .getValue(); + return this; + } + + KubernetesConfigurationPrivateLinkScopeImpl(String name, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = new KubernetesConfigurationPrivateLinkScopeInner(); + this.serviceManager = serviceManager; + this.scopeName = name; + } + + public KubernetesConfigurationPrivateLinkScopeImpl update() { + this.updatePrivateLinkScopeTags = new TagsResource(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope apply() { + this.innerObject = serviceManager.serviceClient() + .getPrivateLinkScopes() + .updateTagsWithResponse(resourceGroupName, scopeName, updatePrivateLinkScopeTags, Context.NONE) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateLinkScopes() + .updateTagsWithResponse(resourceGroupName, scopeName, updatePrivateLinkScopeTags, context) + .getValue(); + return this; + } + + KubernetesConfigurationPrivateLinkScopeImpl(KubernetesConfigurationPrivateLinkScopeInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scopeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateLinkScopes"); + } + + public KubernetesConfigurationPrivateLinkScope refresh() { + this.innerObject = serviceManager.serviceClient() + .getPrivateLinkScopes() + .getByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScope refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateLinkScopes() + .getByResourceGroupWithResponse(resourceGroupName, scopeName, context) + .getValue(); + return this; + } + + public KubernetesConfigurationPrivateLinkScopeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public KubernetesConfigurationPrivateLinkScopeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public KubernetesConfigurationPrivateLinkScopeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updatePrivateLinkScopeTags.withTags(tags); + return this; + } + } + + public KubernetesConfigurationPrivateLinkScopeImpl + withProperties(KubernetesConfigurationPrivateLinkScopeProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..1e4827e0f8c4 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpoint; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String scopeName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingPrivateLinkScope(String resourceGroupName, String scopeName) { + this.resourceGroupName = resourceGroupName; + this.scopeName = scopeName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, scopeName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scopeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateLinkScopes"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 000000000000..80b67897e7f4 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnectionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { + private PrivateEndpointConnectionListResultInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + PrivateEndpointConnectionListResultImpl(PrivateEndpointConnectionListResultInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..7b6d371d5845 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,790 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionListResultInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final PrivateLinkScopesManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(PrivateLinkScopesManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkScopesManagementClientPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkScopesMan") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByPrivateLinkScopeSync( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String scopeName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, privateEndpointConnectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String scopeName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, privateEndpointConnectionName, accept, context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String scopeName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), scopeName, privateEndpointConnectionName, properties, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, privateEndpointConnectionName, properties, accept, Context.NONE); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, privateEndpointConnectionName, properties, accept, context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + Response response + = createOrUpdateWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, properties); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String scopeName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, scopeName, + privateEndpointConnectionName, properties, context); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return beginCreateOrUpdateAsync(resourceGroupName, scopeName, privateEndpointConnectionName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return beginCreateOrUpdate(resourceGroupName, scopeName, privateEndpointConnectionName, properties) + .getFinalResult(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { + return beginCreateOrUpdate(resourceGroupName, scopeName, privateEndpointConnectionName, properties, context) + .getFinalResult(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String scopeName, + String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, privateEndpointConnectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + return deleteWithResponseAsync(resourceGroupName, scopeName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, privateEndpointConnectionName, accept, context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + deleteWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByPrivateLinkScopeWithResponseAsync(String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScope(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), scopeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByPrivateLinkScopeAsync(String resourceGroupName, + String scopeName) { + return listByPrivateLinkScopeWithResponseAsync(resourceGroupName, scopeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listByPrivateLinkScopeWithResponse(String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByPrivateLinkScopeSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), scopeName, accept, context); + } + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionListResultInner listByPrivateLinkScope(String resourceGroupName, String scopeName) { + return listByPrivateLinkScopeWithResponse(resourceGroupName, scopeName, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionsImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..f7c08f52f7f2 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String scopeName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, scopeName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context); + } + + public void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, scopeName, privateEndpointConnectionName); + } + + public Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context) { + Response inner + = this.serviceClient().listByPrivateLinkScopeWithResponse(resourceGroupName, scopeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnectionListResult listByPrivateLinkScope(String resourceGroupName, String scopeName) { + PrivateEndpointConnectionListResultInner inner + = this.serviceClient().listByPrivateLinkScope(resourceGroupName, scopeName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.deleteWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.deleteWithResponse(resourceGroupName, scopeName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourceImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..57e27bad9a00 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourceListResultImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 000000000000..3ed4a27551d0 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResource; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourcesClientImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..0801a4a74548 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final PrivateLinkScopesManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(PrivateLinkScopesManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkScopesManagementClientPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkScopesMan") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPrivateLinkScope(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByPrivateLinkScopeSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("scopeName") String scopeName, @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByPrivateLinkScopeWithResponseAsync(String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPrivateLinkScope(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), scopeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByPrivateLinkScopeAsync(String resourceGroupName, + String scopeName) { + return listByPrivateLinkScopeWithResponseAsync(resourceGroupName, scopeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByPrivateLinkScopeSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), scopeName, accept, context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByPrivateLinkScope(String resourceGroupName, String scopeName) { + return listByPrivateLinkScopeWithResponse(resourceGroupName, scopeName, Context.NONE).getValue(); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String scopeName, + String groupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), scopeName, groupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String scopeName, String groupName) { + return getWithResponseAsync(resourceGroupName, scopeName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String scopeName, + String groupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (groupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), scopeName, groupName, accept, context); + } + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String scopeName, String groupName) { + return getWithResponse(resourceGroupName, scopeName, groupName, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourcesImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..16a4d9410bfe --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResource; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context) { + Response inner + = this.serviceClient().listByPrivateLinkScopeWithResponse(resourceGroupName, scopeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResourceListResult listByPrivateLinkScope(String resourceGroupName, String scopeName) { + PrivateLinkResourceListResultInner inner + = this.serviceClient().listByPrivateLinkScope(resourceGroupName, scopeName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String scopeName, String groupName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, scopeName, groupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, scopeName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesClientImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesClientImpl.java new file mode 100644 index 000000000000..e52b8ac8196c --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesClientImpl.java @@ -0,0 +1,1118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScopeListResult; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.TagsResource; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkScopesClient. + */ +public final class PrivateLinkScopesClientImpl implements PrivateLinkScopesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateLinkScopesService service; + + /** + * The service client containing this operation class. + */ + private final PrivateLinkScopesManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkScopesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkScopesClientImpl(PrivateLinkScopesManagementClientImpl client) { + this.service + = RestProxy.create(PrivateLinkScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkScopesManagementClientPrivateLinkScopes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkScopesMan") + public interface PrivateLinkScopesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("scopeName") String scopeName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("scopeName") String scopeName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("scopeName") String scopeName, + @BodyParam("application/json") KubernetesConfigurationPrivateLinkScopeInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("scopeName") String scopeName, + @BodyParam("application/json") KubernetesConfigurationPrivateLinkScopeInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("scopeName") String scopeName, + @BodyParam("application/json") TagsResource privateLinkScopeTags, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateTagsSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("scopeName") String scopeName, + @BodyParam("application/json") TagsResource privateLinkScopeTags, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), scopeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String scopeName) { + return deleteWithResponseAsync(resourceGroupName, scopeName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), scopeName, accept, context); + } + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String scopeName) { + deleteWithResponse(resourceGroupName, scopeName, Context.NONE); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String scopeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), scopeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String scopeName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, scopeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getByResourceGroupWithResponse(String resourceGroupName, String scopeName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), scopeName, accept, context); + } + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesConfigurationPrivateLinkScopeInner getByResourceGroup(String resourceGroupName, String scopeName) { + return getByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE).getValue(); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), scopeName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, scopeName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String scopeName, KubernetesConfigurationPrivateLinkScopeInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), scopeName, parameters, accept, context); + } + + /** + * Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for + * InstrumentationKey nor AppId in the Put operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param parameters Properties that need to be specified to create or update a Azure Arc for Servers and Clusters + * PrivateLinkScope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesConfigurationPrivateLinkScopeInner createOrUpdate(String resourceGroupName, String scopeName, + KubernetesConfigurationPrivateLinkScopeInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, scopeName, parameters, Context.NONE).getValue(); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + updateTagsWithResponseAsync(String resourceGroupName, String scopeName, TagsResource privateLinkScopeTags) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateLinkScopeTags == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkScopeTags is required and cannot be null.")); + } else { + privateLinkScopeTags.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), scopeName, privateLinkScopeTags, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, + String scopeName, TagsResource privateLinkScopeTags) { + return updateTagsWithResponseAsync(resourceGroupName, scopeName, privateLinkScopeTags) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String scopeName, TagsResource privateLinkScopeTags, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scopeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scopeName is required and cannot be null.")); + } + if (privateLinkScopeTags == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateLinkScopeTags is required and cannot be null.")); + } else { + privateLinkScopeTags.validate(); + } + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), scopeName, privateLinkScopeTags, accept, context); + } + + /** + * Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateLinkScopeTags Updated tag information to set into the PrivateLinkScope instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KubernetesConfigurationPrivateLinkScopeInner updateTags(String resourceGroupName, String scopeName, + TagsResource privateLinkScopeTags) { + return updateTagsWithResponse(resourceGroupName, scopeName, privateLinkScopeTags, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, + Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of Azure Arc PrivateLinkScope resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkScopesClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesImpl.java new file mode 100644 index 000000000000..c487029055bd --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScope; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkScopes; + +public final class PrivateLinkScopesImpl implements PrivateLinkScopes { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkScopesImpl.class); + + private final PrivateLinkScopesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager; + + public PrivateLinkScopesImpl(PrivateLinkScopesClient innerClient, + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new KubernetesConfigurationPrivateLinkScopeImpl(inner1, this.manager())); + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String scopeName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, scopeName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String scopeName) { + this.serviceClient().delete(resourceGroupName, scopeName); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String scopeName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, scopeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new KubernetesConfigurationPrivateLinkScopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KubernetesConfigurationPrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName) { + KubernetesConfigurationPrivateLinkScopeInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, scopeName); + if (inner != null) { + return new KubernetesConfigurationPrivateLinkScopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public KubernetesConfigurationPrivateLinkScope getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, scopeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, scopeName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String scopeName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinkScopes"); + if (scopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinkScopes'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, scopeName, context); + } + + private PrivateLinkScopesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager() { + return this.serviceManager; + } + + public KubernetesConfigurationPrivateLinkScopeImpl define(String name) { + return new KubernetesConfigurationPrivateLinkScopeImpl(name, this.manager()); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesManagementClientBuilder.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesManagementClientBuilder.java new file mode 100644 index 000000000000..aadd71c17819 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the PrivateLinkScopesManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { PrivateLinkScopesManagementClientImpl.class }) +public final class PrivateLinkScopesManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the PrivateLinkScopesManagementClientBuilder. + */ + public PrivateLinkScopesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the PrivateLinkScopesManagementClientBuilder. + */ + public PrivateLinkScopesManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the PrivateLinkScopesManagementClientBuilder. + */ + public PrivateLinkScopesManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the PrivateLinkScopesManagementClientBuilder. + */ + public PrivateLinkScopesManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the PrivateLinkScopesManagementClientBuilder. + */ + public PrivateLinkScopesManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the PrivateLinkScopesManagementClientBuilder. + */ + public PrivateLinkScopesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of PrivateLinkScopesManagementClientImpl with the provided parameters. + * + * @return an instance of PrivateLinkScopesManagementClientImpl. + */ + public PrivateLinkScopesManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + PrivateLinkScopesManagementClientImpl client = new PrivateLinkScopesManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesManagementClientImpl.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesManagementClientImpl.java new file mode 100644 index 000000000000..3970a6190a12 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/PrivateLinkScopesManagementClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.PrivateLinkScopesManagementClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the PrivateLinkScopesManagementClientImpl type. + */ +@ServiceClient(builder = PrivateLinkScopesManagementClientBuilder.class) +public final class PrivateLinkScopesManagementClientImpl implements PrivateLinkScopesManagementClient { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The PrivateLinkScopesClient object to access its operations. + */ + private final PrivateLinkScopesClient privateLinkScopes; + + /** + * Gets the PrivateLinkScopesClient object to access its operations. + * + * @return the PrivateLinkScopesClient object. + */ + public PrivateLinkScopesClient getPrivateLinkScopes() { + return this.privateLinkScopes; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Initializes an instance of PrivateLinkScopesManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + PrivateLinkScopesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-11-01-preview"; + this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkScopesManagementClientImpl.class); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/ResourceManagerUtils.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..35b231a30b19 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/package-info.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/package-info.java new file mode 100644 index 000000000000..9a28e18409b8 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for PrivateLinkScopesManagementClient. + * PrivateLinkScopes Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation; diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScope.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScope.java new file mode 100644 index 000000000000..d21e05e159a0 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScope.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import java.util.Map; + +/** + * An immutable client-side representation of KubernetesConfigurationPrivateLinkScope. + */ +public interface KubernetesConfigurationPrivateLinkScope { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties that define a Azure Arc PrivateLinkScope resource. + * + * @return the properties value. + */ + KubernetesConfigurationPrivateLinkScopeProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner + * object. + * + * @return the inner object. + */ + KubernetesConfigurationPrivateLinkScopeInner innerModel(); + + /** + * The entirety of the KubernetesConfigurationPrivateLinkScope definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The KubernetesConfigurationPrivateLinkScope definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the KubernetesConfigurationPrivateLinkScope definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the KubernetesConfigurationPrivateLinkScope definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + KubernetesConfigurationPrivateLinkScope create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + KubernetesConfigurationPrivateLinkScope create(Context context); + } + + /** + * The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the KubernetesConfigurationPrivateLinkScope definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties that define a Azure Arc PrivateLinkScope resource.. + * + * @param properties Properties that define a Azure Arc PrivateLinkScope resource. + * @return the next definition stage. + */ + WithCreate withProperties(KubernetesConfigurationPrivateLinkScopeProperties properties); + } + } + + /** + * Begins update for the KubernetesConfigurationPrivateLinkScope resource. + * + * @return the stage of resource update. + */ + KubernetesConfigurationPrivateLinkScope.Update update(); + + /** + * The template for KubernetesConfigurationPrivateLinkScope update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + KubernetesConfigurationPrivateLinkScope apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + KubernetesConfigurationPrivateLinkScope apply(Context context); + } + + /** + * The KubernetesConfigurationPrivateLinkScope update stages. + */ + interface UpdateStages { + /** + * The stage of the KubernetesConfigurationPrivateLinkScope update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + KubernetesConfigurationPrivateLinkScope refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + KubernetesConfigurationPrivateLinkScope refresh(Context context); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScopeListResult.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScopeListResult.java new file mode 100644 index 000000000000..8e7aa84e4a78 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScopeListResult.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.KubernetesConfigurationPrivateLinkScopeInner; +import java.io.IOException; +import java.util.List; + +/** + * Describes the list of Azure Arc PrivateLinkScope resources. + */ +@Fluent +public final class KubernetesConfigurationPrivateLinkScopeListResult + implements JsonSerializable { + /* + * List of Azure Arc PrivateLinkScope definitions. + */ + private List value; + + /* + * The URI to get the next set of Azure Arc PrivateLinkScope definitions if too many PrivateLinkScopes where + * returned in the result set. + */ + private String nextLink; + + /** + * Creates an instance of KubernetesConfigurationPrivateLinkScopeListResult class. + */ + public KubernetesConfigurationPrivateLinkScopeListResult() { + } + + /** + * Get the value property: List of Azure Arc PrivateLinkScope definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Arc PrivateLinkScope definitions. + * + * @param value the value value to set. + * @return the KubernetesConfigurationPrivateLinkScopeListResult object itself. + */ + public KubernetesConfigurationPrivateLinkScopeListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too many + * PrivateLinkScopes where returned in the result set. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too many + * PrivateLinkScopes where returned in the result set. + * + * @param nextLink the nextLink value to set. + * @return the KubernetesConfigurationPrivateLinkScopeListResult object itself. + */ + public KubernetesConfigurationPrivateLinkScopeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model KubernetesConfigurationPrivateLinkScopeListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(KubernetesConfigurationPrivateLinkScopeListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesConfigurationPrivateLinkScopeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesConfigurationPrivateLinkScopeListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KubernetesConfigurationPrivateLinkScopeListResult. + */ + public static KubernetesConfigurationPrivateLinkScopeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesConfigurationPrivateLinkScopeListResult deserializedKubernetesConfigurationPrivateLinkScopeListResult + = new KubernetesConfigurationPrivateLinkScopeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> KubernetesConfigurationPrivateLinkScopeInner.fromJson(reader1)); + deserializedKubernetesConfigurationPrivateLinkScopeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesConfigurationPrivateLinkScopeListResult; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScopeProperties.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScopeProperties.java new file mode 100644 index 000000000000..03f31c2eadca --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/KubernetesConfigurationPrivateLinkScopeProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Properties that define a Azure Arc PrivateLinkScope resource. + */ +@Fluent +public final class KubernetesConfigurationPrivateLinkScopeProperties + implements JsonSerializable { + /* + * Indicates whether machines associated with the private link scope can also use public Azure Arc service + * endpoints. + */ + private PublicNetworkAccessType publicNetworkAccess; + + /* + * Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is + * defined. Users cannot change this value but are able to read from it. Values will include Provisioning + * ,Succeeded, Canceled and Failed. + */ + private ProvisioningState provisioningState; + + /* + * Managed Cluster ARM ID for the private link scope (Required) + */ + private String clusterResourceId; + + /* + * The Guid id of the private link scope. + */ + private String privateLinkScopeId; + + /* + * The collection of associated Private Endpoint Connections. + */ + private List privateEndpointConnections; + + /** + * Creates an instance of KubernetesConfigurationPrivateLinkScopeProperties class. + */ + public KubernetesConfigurationPrivateLinkScopeProperties() { + } + + /** + * Get the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccessType publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Indicates whether machines associated with the private link scope can also + * use public Azure Arc service endpoints. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the KubernetesConfigurationPrivateLinkScopeProperties object itself. + */ + public KubernetesConfigurationPrivateLinkScopeProperties + withPublicNetworkAccess(PublicNetworkAccessType publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the provisioningState property: Current state of this PrivateLinkScope: whether or not is has been + * provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. + * Values will include Provisioning ,Succeeded, Canceled and Failed. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterResourceId property: Managed Cluster ARM ID for the private link scope (Required). + * + * @return the clusterResourceId value. + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the clusterResourceId property: Managed Cluster ARM ID for the private link scope (Required). + * + * @param clusterResourceId the clusterResourceId value to set. + * @return the KubernetesConfigurationPrivateLinkScopeProperties object itself. + */ + public KubernetesConfigurationPrivateLinkScopeProperties withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the privateLinkScopeId property: The Guid id of the private link scope. + * + * @return the privateLinkScopeId value. + */ + public String privateLinkScopeId() { + return this.privateLinkScopeId; + } + + /** + * Get the privateEndpointConnections property: The collection of associated Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property clusterResourceId in model KubernetesConfigurationPrivateLinkScopeProperties")); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(KubernetesConfigurationPrivateLinkScopeProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterResourceId", this.clusterResourceId); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesConfigurationPrivateLinkScopeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesConfigurationPrivateLinkScopeProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KubernetesConfigurationPrivateLinkScopeProperties. + */ + public static KubernetesConfigurationPrivateLinkScopeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesConfigurationPrivateLinkScopeProperties deserializedKubernetesConfigurationPrivateLinkScopeProperties + = new KubernetesConfigurationPrivateLinkScopeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterResourceId".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeProperties.clusterResourceId + = reader.getString(); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeProperties.publicNetworkAccess + = PublicNetworkAccessType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateLinkScopeId".equals(fieldName)) { + deserializedKubernetesConfigurationPrivateLinkScopeProperties.privateLinkScopeId + = reader.getString(); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedKubernetesConfigurationPrivateLinkScopeProperties.privateEndpointConnections + = privateEndpointConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesConfigurationPrivateLinkScopeProperties; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpoint.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpoint.java new file mode 100644 index 000000000000..e4535e3d1758 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpoint.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Private Endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The ARM identifier for Private Endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnection.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..ab64ae42e61b --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnection.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PrivateEndpointConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, scopeName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @return the next definition stage. + */ + WithCreate withExistingPrivateLinkScope(String resourceGroupName, String scopeName); + } + + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** + * The template for PrivateEndpointConnection update. + */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + + /** + * The PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnectionListResult.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..1386ed0f1014 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateEndpointConnectionListResult. + */ +public interface PrivateEndpointConnectionListResult { + /** + * Gets the value property: Array of private endpoint connections. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateEndpointConnectionListResultInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionListResultInner innerModel(); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnectionProvisioningState.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..f1899d83cf24 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnections.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..9351c50292ca --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointConnections.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String scopeName, + String privateEndpointConnectionName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String scopeName, String privateEndpointConnectionName, + Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String scopeName, String privateEndpointConnectionName); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope along with {@link Response}. + */ + Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context); + + /** + * Gets all private endpoint connections on a private link scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections on a private link scope. + */ + PrivateEndpointConnectionListResult listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointServiceConnectionStatus.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..544eb4395d75 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResource.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResource.java new file mode 100644 index 000000000000..4806e0bda97a --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResource.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResourceListResult.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..43c1daecdb53 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResourceListResult.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResourceListResult. + */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models.PrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResources.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResources.java new file mode 100644 index 000000000000..d84952adab91 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkResources.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response}. + */ + Response listByPrivateLinkScopeWithResponse(String resourceGroupName, + String scopeName, Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + PrivateLinkResourceListResult listByPrivateLinkScope(String resourceGroupName, String scopeName); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String scopeName, String groupName, + Context context); + + /** + * Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + */ + PrivateLinkResource get(String resourceGroupName, String scopeName, String groupName); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkScopes.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkScopes.java new file mode 100644 index 000000000000..7abef46c178e --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkScopes.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PrivateLinkScopes. + */ +public interface PrivateLinkScopes { + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all Azure Arc PrivateLinkScopes within a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Arc PrivateLinkScopes within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Azure Arc PrivateLinkScopes within a resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String scopeName, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String scopeName, Context context); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param scopeName The name of the Azure Arc PrivateLinkScope resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition. + */ + KubernetesConfigurationPrivateLinkScope getByResourceGroup(String resourceGroupName, String scopeName); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + KubernetesConfigurationPrivateLinkScope getById(String id); + + /** + * Returns a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Arc PrivateLinkScope definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Azure Arc PrivateLinkScope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new KubernetesConfigurationPrivateLinkScope resource. + * + * @param name resource name. + * @return the first stage of the new KubernetesConfigurationPrivateLinkScope definition. + */ + KubernetesConfigurationPrivateLinkScope.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkServiceConnectionState.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..d6ee4f81aafd --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/ProvisioningState.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/ProvisioningState.java new file mode 100644 index 000000000000..c7760e874e34 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/ProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PublicNetworkAccessType.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PublicNetworkAccessType.java new file mode 100644 index 000000000000..4024b06c9cdd --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/PublicNetworkAccessType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The network access policy to determine if Azure Arc agents can use public Azure Arc service endpoints. Defaults to + * disabled (access to Azure Arc services only via private link). + */ +public final class PublicNetworkAccessType extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccessType. + */ + public static final PublicNetworkAccessType ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccessType. + */ + public static final PublicNetworkAccessType DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccessType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccessType() { + } + + /** + * Creates or finds a PublicNetworkAccessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccessType. + */ + public static PublicNetworkAccessType fromString(String name) { + return fromString(name, PublicNetworkAccessType.class); + } + + /** + * Gets known PublicNetworkAccessType values. + * + * @return known PublicNetworkAccessType values. + */ + public static Collection values() { + return values(PublicNetworkAccessType.class); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/TagsResource.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/TagsResource.java new file mode 100644 index 000000000000..2a6067c7c0c7 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/TagsResource.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope + * instance. + */ +@Fluent +public final class TagsResource implements JsonSerializable { + /* + * Resource tags + */ + private Map tags; + + /** + * Creates an instance of TagsResource class. + */ + public TagsResource() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsResource object itself. + */ + public TagsResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagsResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagsResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagsResource. + */ + public static TagsResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagsResource deserializedTagsResource = new TagsResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTagsResource.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedTagsResource; + }); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/package-info.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/package-info.java new file mode 100644 index 000000000000..2c9ee3e082ba --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for PrivateLinkScopesManagementClient. + * PrivateLinkScopes Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationprivateli.models; diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/package-info.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/package-info.java new file mode 100644 index 000000000000..e62e4b92648b --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for PrivateLinkScopesManagementClient. + * PrivateLinkScopes Client. + */ +package com.azure.resourcemanager.kubernetesconfigurationprivateli; diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/module-info.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/module-info.java new file mode 100644 index 000000000000..77d971ebd42a --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.kubernetesconfigurationprivateli { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.kubernetesconfigurationprivateli; + exports com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent; + exports com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models; + exports com.azure.resourcemanager.kubernetesconfigurationprivateli.models; + + opens com.azure.resourcemanager.kubernetesconfigurationprivateli.fluent.models to com.azure.core; + opens com.azure.resourcemanager.kubernetesconfigurationprivateli.models to com.azure.core; +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationprivateli/proxy-config.json b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationprivateli/proxy-config.json new file mode 100644 index 000000000000..61a146b46f3f --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationprivateli/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.kubernetesconfigurationprivateli.implementation.PrivateLinkScopesClientImpl$PrivateLinkScopesService"]] \ No newline at end of file diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationprivateli/reflect-config.json b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationprivateli/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-kubernetesconfigurationprivateli/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/azure-resourcemanager-kubernetesconfigurationprivateli.properties b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/azure-resourcemanager-kubernetesconfigurationprivateli.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/main/resources/azure-resourcemanager-kubernetesconfigurationprivateli.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsCreateOrU.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsCreateOrU.java new file mode 100644 index 000000000000..32863a582ee2 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsCreateOrU.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrU { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .define("private-endpoint-connection-name") + .withExistingPrivateLinkScope("myResourceGroup", "myPrivateLinkScope") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")) + .create(); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsDeleteSam.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsDeleteSam.java new file mode 100644 index 000000000000..873e2e6a48d0 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsDeleteSam.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSam { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .deleteWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..6a1d509a0323 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsListByPri.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsListByPri.java new file mode 100644 index 000000000000..061bec66a08a --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateEndpointConnectionsListByPri.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateEndpointConnections ListByPrivateLinkScope. + */ +public final class PrivateEndpointConnectionsListByPri { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a private link scope. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAPrivateLinkScope( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateEndpointConnections() + .listByPrivateLinkScopeWithResponse("myResourceGroup", "myPrivateLinkScope", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkResourcesGetSamples.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..ed139eac4700 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkResources() + .getWithResponse("myResourceGroup", "myPrivateLinkScope", "KubernetesConfiguration", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkResourcesListByPrivateLi.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkResourcesListByPrivateLi.java new file mode 100644 index 000000000000..46fe686a59bd --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkResourcesListByPrivateLi.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateLinkResources ListByPrivateLinkScope. + */ +public final class PrivateLinkResourcesListByPrivateLi { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkResources() + .listByPrivateLinkScopeWithResponse("myResourceGroup", "myPrivateLinkScope", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesCreateOrUpdateSamp.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesCreateOrUpdateSamp.java new file mode 100644 index 000000000000..6c674b3b3f05 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesCreateOrUpdateSamp.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PrivateLinkScopes CreateOrUpdate. + */ +public final class PrivateLinkScopesCreateOrUpdateSamp { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesCreate.json + */ + /** + * Sample code: PrivateLinkScopeCreate. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeCreate( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .create(); + } + + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesUpdate.json + */ + /** + * Sample code: PrivateLinkScopeUpdate. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeUpdate( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .define("my-privatelinkscope") + .withRegion("westus") + .withExistingResourceGroup("my-resource-group") + .withTags(mapOf("Tag1", "Value1")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesDeleteSamples.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesDeleteSamples.java new file mode 100644 index 000000000000..1025d4b6e4ec --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateLinkScopes Delete. + */ +public final class PrivateLinkScopesDeleteSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesDelete.json + */ + /** + * Sample code: PrivateLinkScopesDelete. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopesDelete( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .deleteByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesGetByResourceGroup.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesGetByResourceGroup.java new file mode 100644 index 000000000000..61b1027a14fc --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesGetByResourceGroup.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateLinkScopes GetByResourceGroup. + */ +public final class PrivateLinkScopesGetByResourceGroup { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesGet.json + */ + /** + * Sample code: PrivateLinkScopeGet. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeGet( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesListByResourceGrou.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesListByResourceGrou.java new file mode 100644 index 000000000000..ec0e8f49423b --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesListByResourceGrou.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateLinkScopes ListByResourceGroup. + */ +public final class PrivateLinkScopesListByResourceGrou { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesListByResourceGroup.json + */ + /** + * Sample code: PrivateLinkScopeListByResourceGroup. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeListByResourceGroup( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes().listByResourceGroup("my-resource-group", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesListSamples.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesListSamples.java new file mode 100644 index 000000000000..3135c0e8ae90 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +/** + * Samples for PrivateLinkScopes List. + */ +public final class PrivateLinkScopesListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesList.json + */ + /** + * Sample code: PrivateLinkScopesList.json. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopesListJson( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + manager.privateLinkScopes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesUpdateTagsSamples.java b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesUpdateTagsSamples.java new file mode 100644 index 000000000000..5dd92b5313af --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/src/samples/java/com/azure/resourcemanager/kubernetesconfigurationprivateli/generated/PrivateLinkScopesUpdateTagsSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfigurationprivateli.generated; + +import com.azure.resourcemanager.kubernetesconfigurationprivateli.models.KubernetesConfigurationPrivateLinkScope; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PrivateLinkScopes UpdateTags. + */ +public final class PrivateLinkScopesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/privateLinkScopes/ + * preview/2024-11-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + */ + /** + * Sample code: PrivateLinkScopeUpdateTagsOnly. + * + * @param manager Entry point to PrivateLinkScopesManager. + */ + public static void privateLinkScopeUpdateTagsOnly( + com.azure.resourcemanager.kubernetesconfigurationprivateli.PrivateLinkScopesManager manager) { + KubernetesConfigurationPrivateLinkScope resource = manager.privateLinkScopes() + .getByResourceGroupWithResponse("my-resource-group", "my-privatelinkscope", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Tag1", "Value1", "Tag2", "Value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/kubernetesconfigurationprivateli/ci.yml b/sdk/kubernetesconfigurationprivateli/ci.yml new file mode 100644 index 000000000000..39ee85a7af92 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfigurationprivateli/ci.yml + - sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/ + exclude: + - sdk/kubernetesconfigurationprivateli/pom.xml + - sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfigurationprivateli/ci.yml + - sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/ + exclude: + - sdk/kubernetesconfigurationprivateli/pom.xml + - sdk/kubernetesconfigurationprivateli/azure-resourcemanager-kubernetesconfigurationprivateli/pom.xml + +parameters: + - name: release_azureresourcemanagerkubernetesconfigurationprivateli + displayName: azure-resourcemanager-kubernetesconfigurationprivateli + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: kubernetesconfigurationprivateli + Artifacts: + - name: azure-resourcemanager-kubernetesconfigurationprivateli + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkubernetesconfigurationprivateli + releaseInBatch: ${{ parameters.release_azureresourcemanagerkubernetesconfigurationprivateli }} diff --git a/sdk/kubernetesconfigurationprivateli/pom.xml b/sdk/kubernetesconfigurationprivateli/pom.xml new file mode 100644 index 000000000000..5158e64ce176 --- /dev/null +++ b/sdk/kubernetesconfigurationprivateli/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-kubernetesconfigurationprivateli-service + pom + 1.0.0 + + + azure-resourcemanager-kubernetesconfigurationprivateli + +