From e4a2d9a74c373a3cea6a34b1e5f538867afcd11c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 17 Aug 2021 02:36:01 +0000 Subject: [PATCH] CodeGen from PR 15240 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.PowerBI to add version stable/2020-06-01 (#15240) * New Swagger Spec File * New Swagger Example Spec File * New Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Go Language Readme Config File * New Python Language Readme Config File * New Typescript Language Readme Config File * New C# Language Readme Config File * Adding swaggers for Power BI private links * Fixed Lint erros. * Fixed spellcheck * Fixed Lint errors * fixed Avocado error * fixed model validation * fixed model validation. * updated private endpoint connections * updated PrivateLinkResources * updated PrivateLinkResource * updated private endpoint connection proxies * fixed model validation. * updated connectionstate * renamed connection files * update readme file. * updated python readme * fixed code review comments * updated error ref. * Removed Error and linked to common-type. * added 201 to put request * removed unnecessary definitions. * updates examples for 201 * updated list of * removed extra space * Added patch to PowerBIResource * added 202 to PrivateLinkServiceResourceOperationResults_Get * updated readme files * added provisioning state * trying to fix sdk error * removed privateEndpointConnectionProxies * added PrivateLinkResources_Get * added privateLinkResourceName in example * removed privateLinkServicesForPowerBI from URL * added nextLink * fixed prettier * Fixed error for Prettier --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 101 ++ .../pom.xml | 86 ++ .../PrivateLinkServicesForPowerBIManager.java | 308 +++++ .../fluent/OperationsClient.java | 36 + .../fluent/PowerBIResourcesClient.java | 141 +++ .../PrivateEndpointConnectionsClient.java | 173 +++ .../fluent/PrivateLinkResourcesClient.java | 73 ++ ...ServiceResourceOperationResultsClient.java | 69 ++ .../fluent/PrivateLinkServicesClient.java | 40 + .../PrivateLinkServicesForPowerBIClient.java | 95 ++ .../PrivateLinkServicesForPowerBIsClient.java | 37 + .../models/AsyncOperationDetailInner.java | 181 +++ .../fluent/models/OperationInner.java | 125 ++ .../PrivateEndpointConnectionInner.java | 131 +++ .../models/PrivateLinkResourceInner.java | 161 +++ .../fluent/models/TenantResourceInner.java | 115 ++ .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + .../AsyncOperationDetailImpl.java | 54 + .../implementation/OperationImpl.java | 52 + .../implementation/OperationsClientImpl.java | 269 +++++ .../implementation/OperationsImpl.java | 47 + .../PowerBIResourcesClientImpl.java | 847 ++++++++++++++ .../implementation/PowerBIResourcesImpl.java | 132 +++ .../PrivateEndpointConnectionImpl.java | 142 +++ .../PrivateEndpointConnectionsClientImpl.java | 1039 +++++++++++++++++ .../PrivateEndpointConnectionsImpl.java | 223 ++++ .../PrivateLinkResourceImpl.java | 65 ++ .../PrivateLinkResourcesClientImpl.java | 529 +++++++++ .../PrivateLinkResourcesImpl.java | 79 ++ ...iceResourceOperationResultsClientImpl.java | 299 +++++ ...nkServiceResourceOperationResultsImpl.java | 56 + .../PrivateLinkServicesClientImpl.java | 207 ++++ ...teLinkServicesForPowerBIClientBuilder.java | 147 +++ ...ivateLinkServicesForPowerBIClientImpl.java | 379 ++++++ ...vateLinkServicesForPowerBIsClientImpl.java | 188 +++ .../PrivateLinkServicesForPowerBIsImpl.java | 72 ++ .../PrivateLinkServicesImpl.java | 73 ++ .../implementation/TenantResourceImpl.java | 206 ++++ .../implementation/Utils.java | 204 ++++ .../implementation/package-info.java | 9 + .../models/ActionType.java | 31 + .../models/AsyncOperationDetail.java | 60 + .../models/ConnectionState.java | 102 ++ .../powerbiprivatelinks/models/Operation.java | 56 + .../models/OperationDisplay.java | 93 ++ .../models/OperationListResult.java | 62 + .../models/Operations.java | 31 + .../powerbiprivatelinks/models/Origin.java | 37 + .../models/PersistedConnectionStatus.java | 40 + .../models/PowerBIResources.java | 92 ++ .../models/PrivateEndpoint.java | 50 + .../models/PrivateEndpointConnection.java | 159 +++ .../PrivateEndpointConnectionListResult.java | 71 ++ .../models/PrivateEndpointConnections.java | 143 +++ ...ivateEndpointConnectionsDeleteHeaders.java | 50 + ...vateEndpointConnectionsDeleteResponse.java | 31 + .../models/PrivateLinkResource.java | 60 + .../models/PrivateLinkResources.java | 66 ++ .../PrivateLinkResourcesListResult.java | 70 ++ ...teLinkServiceResourceOperationResults.java | 33 + .../models/PrivateLinkServices.java | 35 + .../PrivateLinkServicesForPowerBIs.java | 32 + .../models/ResourceProvisioningState.java | 46 + .../models/TenantResource.java | 276 +++++ .../models/package-info.java | 9 + .../powerbiprivatelinks/package-info.java | 9 + .../src/main/java/module-info.java | 19 + sdk/powerbiprivatelinks/ci.yml | 39 + sdk/powerbiprivatelinks/pom.xml | 53 + 73 files changed, 9070 insertions(+) create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/CHANGELOG.md create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/README.md create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/pom.xml create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/PrivateLinkServicesForPowerBIManager.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/OperationsClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PowerBIResourcesClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServiceResourceOperationResultsClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIsClient.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/AsyncOperationDetailInner.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/OperationInner.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/TenantResourceInner.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/package-info.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/package-info.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/AsyncOperationDetailImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientBuilder.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsClientImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/TenantResourceImpl.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/Utils.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/package-info.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ActionType.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/AsyncOperationDetail.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ConnectionState.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operation.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationDisplay.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationListResult.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operations.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Origin.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PersistedConnectionStatus.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PowerBIResources.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpoint.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnection.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnections.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteHeaders.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteResponse.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResource.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResources.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResourcesListResult.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServiceResourceOperationResults.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServices.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServicesForPowerBIs.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ResourceProvisioningState.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/TenantResource.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/package-info.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/package-info.java create mode 100644 sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/module-info.java create mode 100644 sdk/powerbiprivatelinks/ci.yml create mode 100644 sdk/powerbiprivatelinks/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 71690bc25afbc..99da42e600c39 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -312,6 +312,7 @@ com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-powerbiprivatelinks;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index efe3902c0dbe0..34ffdb12294f3 100644 --- a/pom.xml +++ b/pom.xml @@ -793,6 +793,7 @@ sdk/postgresql sdk/postgresqlflexibleserver sdk/powerbidedicated + sdk/powerbiprivatelinks sdk/purview sdk/quantum sdk/recoveryservices diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/CHANGELOG.md b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/CHANGELOG.md new file mode 100644 index 0000000000000..d0a20ce572cda --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-08-17) + +- Azure Resource Manager PrivateLinkServicesForPowerBI client library for Java. This package contains Microsoft Azure SDK for PrivateLinkServicesForPowerBI Management SDK. Client to manage Power BI Private Link Service resources and connection members. Package tag package-2020-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/README.md b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/README.md new file mode 100644 index 0000000000000..3fa04b8eb68c8 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager PrivateLinkServicesForPowerBI client library for Java + +Azure Resource Manager PrivateLinkServicesForPowerBI client library for Java. + +This package contains Microsoft Azure SDK for PrivateLinkServicesForPowerBI Management SDK. Client to manage Power BI Private Link Service resources and connection members. Package tag package-2020-06-01. 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-powerbiprivatelinks;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-powerbiprivatelinks + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +PrivateLinkServicesForPowerBIManager manager = PrivateLinkServicesForPowerBIManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/pom.xml b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/pom.xml new file mode 100644 index 0000000000000..c2a7bb837f526 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-powerbiprivatelinks + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for PrivateLinkServicesForPowerBI Management + This package contains Microsoft Azure SDK for PrivateLinkServicesForPowerBI Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Client to manage Power BI Private Link Service resources and connection members. Package tag package-2020-06-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.19.0 + + + com.azure + azure-core-management + 1.4.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/PrivateLinkServicesForPowerBIManager.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/PrivateLinkServicesForPowerBIManager.java new file mode 100644 index 0000000000000..e81d438529d9f --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/PrivateLinkServicesForPowerBIManager.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServicesForPowerBIClient; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.OperationsImpl; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PowerBIResourcesImpl; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PrivateLinkServiceResourceOperationResultsImpl; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PrivateLinkServicesForPowerBIClientBuilder; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PrivateLinkServicesForPowerBIsImpl; +import com.azure.resourcemanager.powerbiprivatelinks.implementation.PrivateLinkServicesImpl; +import com.azure.resourcemanager.powerbiprivatelinks.models.Operations; +import com.azure.resourcemanager.powerbiprivatelinks.models.PowerBIResources; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpointConnections; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkResources; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkServiceResourceOperationResults; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkServices; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkServicesForPowerBIs; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Entry point to PrivateLinkServicesForPowerBIManager. Client to manage Power BI Private Link Service resources and + * connection members. + */ +public final class PrivateLinkServicesForPowerBIManager { + private Operations operations; + + private PrivateLinkServicesForPowerBIs privateLinkServicesForPowerBIs; + + private PrivateLinkServiceResourceOperationResults privateLinkServiceResourceOperationResults; + + private PrivateLinkServices privateLinkServices; + + private PowerBIResources powerBIResources; + + private PrivateLinkResources privateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + + private final PrivateLinkServicesForPowerBIClient clientObject; + + private PrivateLinkServicesForPowerBIManager( + HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new PrivateLinkServicesForPowerBIClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of PrivateLinkServicesForPowerBI service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PrivateLinkServicesForPowerBI service API instance. + */ + public static PrivateLinkServicesForPowerBIManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create PrivateLinkServicesForPowerBIManager with optional + * configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new PrivateLinkServicesForPowerBIManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * 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 default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of PrivateLinkServicesForPowerBI service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PrivateLinkServicesForPowerBI service API instance. + */ + public PrivateLinkServicesForPowerBIManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.powerbiprivatelinks") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new PrivateLinkServicesForPowerBIManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of PrivateLinkServicesForPowerBIs. */ + public PrivateLinkServicesForPowerBIs privateLinkServicesForPowerBIs() { + if (this.privateLinkServicesForPowerBIs == null) { + this.privateLinkServicesForPowerBIs = + new PrivateLinkServicesForPowerBIsImpl(clientObject.getPrivateLinkServicesForPowerBIs(), this); + } + return privateLinkServicesForPowerBIs; + } + + /** @return Resource collection API of PrivateLinkServiceResourceOperationResults. */ + public PrivateLinkServiceResourceOperationResults privateLinkServiceResourceOperationResults() { + if (this.privateLinkServiceResourceOperationResults == null) { + this.privateLinkServiceResourceOperationResults = + new PrivateLinkServiceResourceOperationResultsImpl( + clientObject.getPrivateLinkServiceResourceOperationResults(), this); + } + return privateLinkServiceResourceOperationResults; + } + + /** @return Resource collection API of PrivateLinkServices. */ + public PrivateLinkServices privateLinkServices() { + if (this.privateLinkServices == null) { + this.privateLinkServices = new PrivateLinkServicesImpl(clientObject.getPrivateLinkServices(), this); + } + return privateLinkServices; + } + + /** @return Resource collection API of PowerBIResources. */ + public PowerBIResources powerBIResources() { + if (this.powerBIResources == null) { + this.powerBIResources = new PowerBIResourcesImpl(clientObject.getPowerBIResources(), this); + } + return powerBIResources; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * @return Wrapped service client PrivateLinkServicesForPowerBIClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public PrivateLinkServicesForPowerBIClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/OperationsClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/OperationsClient.java new file mode 100644 index 0000000000000..5f5944783aa13 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Power BI RP operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Power BI RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PowerBIResourcesClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PowerBIResourcesClient.java new file mode 100644 index 0000000000000..19332e0de6184 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PowerBIResourcesClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in PowerBIResourcesClient. */ +public interface PowerBIResourcesClient { + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getByResourceGroup(String resourceGroupName, String azureResourceName); + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> getByResourceGroupWithResponse( + String resourceGroupName, String azureResourceName, Context context); + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TenantResourceInner create(String resourceGroupName, String azureResourceName, TenantResourceInner body); + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @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 tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String azureResourceName, + TenantResourceInner body, + String clientTenantId, + Context context); + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TenantResourceInner update(String resourceGroupName, String azureResourceName, TenantResourceInner body); + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @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 tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String azureResourceName, + TenantResourceInner body, + String clientTenantId, + Context context); + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 azureResourceName); + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String azureResourceName, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateEndpointConnectionsClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..62062a3697b0e --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource(String resourceGroupName, String azureResourceName); + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context); + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String azureResourceName, String privateEndpointName); + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context); + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @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 privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @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 privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String azureResourceName, String privateEndpointName); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 azureResourceName, String privateEndpointName); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String azureResourceName, String privateEndpointName, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkResourcesClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..e56f5253d0e61 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource(String resourceGroupName, String azureResourceName); + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context); + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String azureResourceName, String privateLinkResourceName); + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateLinkResourceName, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServiceResourceOperationResultsClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServiceResourceOperationResultsClient.java new file mode 100644 index 0000000000000..f54c44c9cc7bc --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServiceResourceOperationResultsClient.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.powerbiprivatelinks.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.AsyncOperationDetailInner; + +/** + * An instance of this class provides access to all the operations defined in + * PrivateLinkServiceResourceOperationResultsClient. + */ +public interface PrivateLinkServiceResourceOperationResultsClient { + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AsyncOperationDetailInner> beginGet(String operationId); + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AsyncOperationDetailInner> beginGet( + String operationId, Context context); + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AsyncOperationDetailInner get(String operationId); + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AsyncOperationDetailInner get(String operationId, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesClient.java new file mode 100644 index 0000000000000..e69594761d0e9 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in PrivateLinkServicesClient. */ +public interface PrivateLinkServicesClient { + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listByResourceGroup(String resourceGroupName); + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listByResourceGroupWithResponse(String resourceGroupName, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIClient.java new file mode 100644 index 0000000000000..f6cd1204e5cf9 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIClient.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for PrivateLinkServicesForPowerBIClient class. */ +public interface PrivateLinkServicesForPowerBIClient { + /** + * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PrivateLinkServicesForPowerBIsClient object to access its operations. + * + * @return the PrivateLinkServicesForPowerBIsClient object. + */ + PrivateLinkServicesForPowerBIsClient getPrivateLinkServicesForPowerBIs(); + + /** + * Gets the PrivateLinkServiceResourceOperationResultsClient object to access its operations. + * + * @return the PrivateLinkServiceResourceOperationResultsClient object. + */ + PrivateLinkServiceResourceOperationResultsClient getPrivateLinkServiceResourceOperationResults(); + + /** + * Gets the PrivateLinkServicesClient object to access its operations. + * + * @return the PrivateLinkServicesClient object. + */ + PrivateLinkServicesClient getPrivateLinkServices(); + + /** + * Gets the PowerBIResourcesClient object to access its operations. + * + * @return the PowerBIResourcesClient object. + */ + PowerBIResourcesClient getPowerBIResources(); + + /** + * 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/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIsClient.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIsClient.java new file mode 100644 index 0000000000000..21806485ad5e5 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/PrivateLinkServicesForPowerBIsClient.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in PrivateLinkServicesForPowerBIsClient. */ +public interface PrivateLinkServicesForPowerBIsClient { + /** + * Gets all the private link resources for the given subscription id. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listBySubscriptionId(); + + /** + * Gets all the private link resources for the given subscription 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 all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listBySubscriptionIdWithResponse(Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/AsyncOperationDetailInner.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/AsyncOperationDetailInner.java new file mode 100644 index 0000000000000..5fc8a3a86fe1e --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/AsyncOperationDetailInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AsyncOperationDetail. */ +@Fluent +public final class AsyncOperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AsyncOperationDetailInner.class); + + /* + * The operation id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The operation status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The operation start time. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * The operation end time. + */ + @JsonProperty(value = "endTime") + private String endTime; + + /* + * The error. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** + * Get the id property: The operation id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The operation id. + * + * @param id the id value to set. + * @return the AsyncOperationDetailInner object itself. + */ + public AsyncOperationDetailInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name. + * + * @param name the name value to set. + * @return the AsyncOperationDetailInner object itself. + */ + public AsyncOperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: The operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The operation status. + * + * @param status the status value to set. + * @return the AsyncOperationDetailInner object itself. + */ + public AsyncOperationDetailInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: The operation start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The operation start time. + * + * @param startTime the startTime value to set. + * @return the AsyncOperationDetailInner object itself. + */ + public AsyncOperationDetailInner withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The operation end time. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The operation end time. + * + * @param endTime the endTime value to set. + * @return the AsyncOperationDetailInner object itself. + */ + public AsyncOperationDetailInner withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the error property: The error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: The error. + * + * @param error the error value to set. + * @return the AsyncOperationDetailInner object itself. + */ + public AsyncOperationDetailInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/OperationInner.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..377d66067887d --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/OperationInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.models.ActionType; +import com.azure.resourcemanager.powerbiprivatelinks.models.OperationDisplay; +import com.azure.resourcemanager.powerbiprivatelinks.models.Origin; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateEndpointConnectionInner.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..078ef9057178b --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.models.ConnectionState; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpoint; +import com.azure.resourcemanager.powerbiprivatelinks.models.ResourceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpointConnection. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * PrivateEndpoint Specifies the private endpoint. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Specifies the connection state. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private ConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the Private Endpoint Connection. + */ + @JsonProperty(value = "properties.provisioningState") + private ResourceProvisioningState provisioningState; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: PrivateEndpoint Specifies the private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: PrivateEndpoint Specifies the private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Specifies the connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Specifies the connection state. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + ConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(ResourceProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateLinkResourceInner.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..56c0f602d4e33 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/PrivateLinkResourceInner.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.powerbiprivatelinks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResourceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * Fully qualified identifier of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the id property: Fully qualified identifier of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified identifier of the resource. + * + * @param id the id value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource. + * + * @param type the type value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * 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 PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/TenantResourceInner.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/TenantResourceInner.java new file mode 100644 index 0000000000000..fa2c41d2e7fc4 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/TenantResourceInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** TenantResource. */ +@JsonFlatten +@Fluent +public class TenantResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantResourceInner.class); + + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Specifies the tenant id of the resource. + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * Specifies the private endpoint connections of the resource. + */ + @JsonProperty(value = "properties.privateEndpointConnections") + private List privateEndpointConnections; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the tenantId property: Specifies the tenant id of the resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Specifies the tenant id of the resource. + * + * @param tenantId the tenantId value to set. + * @return the TenantResourceInner object itself. + */ + public TenantResourceInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the privateEndpointConnections property: Specifies the private endpoint connections of the resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: Specifies the private endpoint connections of the resource. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the TenantResourceInner object itself. + */ + public TenantResourceInner withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** {@inheritDoc} */ + @Override + public TenantResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public TenantResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/package-info.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/models/package-info.java new file mode 100644 index 0000000000000..ac98933cadb7d --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/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 PrivateLinkServicesForPowerBIClient. Client to manage Power BI Private + * Link Service resources and connection members. + */ +package com.azure.resourcemanager.powerbiprivatelinks.fluent.models; diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/package-info.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/fluent/package-info.java new file mode 100644 index 0000000000000..c4e45c546e9b8 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/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 PrivateLinkServicesForPowerBIClient. Client to manage Power BI Private + * Link Service resources and connection members. + */ +package com.azure.resourcemanager.powerbiprivatelinks.fluent; diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/AsyncOperationDetailImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/AsyncOperationDetailImpl.java new file mode 100644 index 0000000000000..3f342bfd7f2cd --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/AsyncOperationDetailImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.AsyncOperationDetailInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.AsyncOperationDetail; + +public final class AsyncOperationDetailImpl implements AsyncOperationDetail { + private AsyncOperationDetailInner innerObject; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + AsyncOperationDetailImpl( + AsyncOperationDetailInner innerObject, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public String startTime() { + return this.innerModel().startTime(); + } + + public String endTime() { + return this.innerModel().endTime(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public AsyncOperationDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationImpl.java new file mode 100644 index 0000000000000..5c0dba69fe2b1 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationImpl.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.powerbiprivatelinks.implementation; + +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.ActionType; +import com.azure.resourcemanager.powerbiprivatelinks.models.Operation; +import com.azure.resourcemanager.powerbiprivatelinks.models.OperationDisplay; +import com.azure.resourcemanager.powerbiprivatelinks.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..f00210f45a893 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.OperationsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkServicesForPowerBIClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.PowerBI/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Power BI RP operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Power BI RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Power BI RP operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Power BI RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Power BI RP operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Power BI RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..7c21d678736e5 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.OperationsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.Operation; +import com.azure.resourcemanager.powerbiprivatelinks.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesClientImpl.java new file mode 100644 index 0000000000000..d9719a8b32d26 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesClientImpl.java @@ -0,0 +1,847 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.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.powerbiprivatelinks.fluent.PowerBIResourcesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PowerBIResourcesClient. */ +public final class PowerBIResourcesClientImpl implements PowerBIResourcesClient { + private final ClientLogger logger = new ClientLogger(PowerBIResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PowerBIResourcesService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of PowerBIResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PowerBIResourcesClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy.create(PowerBIResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkServicesForPowerBIClientPowerBIResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface PowerBIResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("x-ms-client-tenant-id") String clientTenantId, + @BodyParam("application/json") TenantResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("x-ms-client-tenant-id") String clientTenantId, + @BodyParam("application/json") TenantResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getByResourceGroupWithResponseAsync( + String resourceGroupName, String azureResourceName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getByResourceGroupWithResponseAsync( + String resourceGroupName, String azureResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupAsync( + String resourceGroupName, String azureResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureResourceName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getByResourceGroup(String resourceGroupName, String azureResourceName) { + return getByResourceGroupAsync(resourceGroupName, azureResourceName).block(); + } + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> getByResourceGroupWithResponse( + String resourceGroupName, String azureResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureResourceName, context).block(); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String azureResourceName, TenantResourceInner body, String clientTenantId) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + clientTenantId, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @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 tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String azureResourceName, + TenantResourceInner body, + String clientTenantId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + clientTenantId, + body, + accept, + context); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String azureResourceName, TenantResourceInner body, String clientTenantId) { + return createWithResponseAsync(resourceGroupName, azureResourceName, body, clientTenantId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String azureResourceName, TenantResourceInner body) { + final String clientTenantId = null; + return createWithResponseAsync(resourceGroupName, azureResourceName, body, clientTenantId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TenantResourceInner create(String resourceGroupName, String azureResourceName, TenantResourceInner body) { + final String clientTenantId = null; + return createAsync(resourceGroupName, azureResourceName, body, clientTenantId).block(); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @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 tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String azureResourceName, + TenantResourceInner body, + String clientTenantId, + Context context) { + return createWithResponseAsync(resourceGroupName, azureResourceName, body, clientTenantId, context).block(); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String azureResourceName, TenantResourceInner body, String clientTenantId) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + clientTenantId, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @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 tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String azureResourceName, + TenantResourceInner body, + String clientTenantId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + clientTenantId, + body, + accept, + context); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String azureResourceName, TenantResourceInner body, String clientTenantId) { + return updateWithResponseAsync(resourceGroupName, azureResourceName, body, clientTenantId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String azureResourceName, TenantResourceInner body) { + final String clientTenantId = null; + return updateWithResponseAsync(resourceGroupName, azureResourceName, body, clientTenantId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TenantResourceInner update(String resourceGroupName, String azureResourceName, TenantResourceInner body) { + final String clientTenantId = null; + return updateAsync(resourceGroupName, azureResourceName, body, clientTenantId).block(); + } + + /** + * Creates or updates a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param body Tenant resource to be created or updated. + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @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 tenantResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String azureResourceName, + TenantResourceInner body, + String clientTenantId, + Context context) { + return updateWithResponseAsync(resourceGroupName, azureResourceName, body, clientTenantId, context).block(); + } + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String azureResourceName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String azureResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String azureResourceName) { + return deleteWithResponseAsync(resourceGroupName, azureResourceName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 azureResourceName) { + deleteAsync(resourceGroupName, azureResourceName).block(); + } + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String azureResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, azureResourceName, context).block(); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesImpl.java new file mode 100644 index 0000000000000..4f841ad8b5fb3 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PowerBIResourcesImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PowerBIResourcesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PowerBIResources; +import com.azure.resourcemanager.powerbiprivatelinks.models.TenantResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PowerBIResourcesImpl implements PowerBIResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PowerBIResourcesImpl.class); + + private final PowerBIResourcesClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public PowerBIResourcesImpl( + PowerBIResourcesClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List getByResourceGroup(String resourceGroupName, String azureResourceName) { + List inner = this.serviceClient().getByResourceGroup(resourceGroupName, azureResourceName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new TenantResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> getByResourceGroupWithResponse( + String resourceGroupName, String azureResourceName, Context context) { + Response> inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, azureResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new TenantResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String azureResourceName) { + this.serviceClient().delete(resourceGroupName, azureResourceName); + } + + public Response deleteWithResponse(String resourceGroupName, String azureResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, azureResourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureResourceName = Utils.getValueFromIdByName(id, "privateLinkServicesForPowerBI"); + if (azureResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'privateLinkServicesForPowerBI'.", + id))); + } + this.deleteWithResponse(resourceGroupName, azureResourceName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureResourceName = Utils.getValueFromIdByName(id, "privateLinkServicesForPowerBI"); + if (azureResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'privateLinkServicesForPowerBI'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, azureResourceName, context); + } + + private PowerBIResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } + + public TenantResourceImpl define(String name) { + return new TenantResourceImpl(name, this.manager()); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..5653420cb9ed8 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.ConnectionState; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpoint; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpointConnection; +import com.azure.resourcemanager.powerbiprivatelinks.models.ResourceProvisioningState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager 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 PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public ConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String azureResourceName; + + private String privateEndpointName; + + public PrivateEndpointConnectionImpl withExistingPrivateLinkServicesForPowerBI( + String resourceGroupName, String azureResourceName) { + this.resourceGroupName = resourceGroupName; + this.azureResourceName = azureResourceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createWithResponse( + resourceGroupName, azureResourceName, privateEndpointName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createWithResponse( + resourceGroupName, azureResourceName, privateEndpointName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + String name, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, azureResourceName, privateEndpointName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, azureResourceName, privateEndpointName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + ConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public PrivateEndpointConnectionImpl withProvisioningState(ResourceProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..b42354ba97ca2 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1039 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpointConnectionListResult; +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 { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkServicesForPowerBIClientPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResource( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}/privateEndpointConnections/{privateEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String azureResourceName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String azureResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceGroupName, String azureResourceName) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, azureResourceName), + nextLink -> listByResourceNextSinglePageAsync(nextLink)); + } + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceGroupName, String azureResourceName, Context context) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, azureResourceName, context), + nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource( + String resourceGroupName, String azureResourceName) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, azureResourceName)); + } + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, azureResourceName, context)); + } + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateEndpointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + return getWithResponseAsync(resourceGroupName, azureResourceName, privateEndpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + return getAsync(resourceGroupName, azureResourceName, privateEndpointName).block(); + } + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 specific private endpoint connection for Power BI by private endpoint name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + return getWithResponseAsync(resourceGroupName, azureResourceName, privateEndpointName, context).block(); + } + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateEndpointName, + this.client.getApiVersion(), + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @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 privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateEndpointName, + this.client.getApiVersion(), + privateEndpointConnection, + accept, + context); + } + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return createWithResponseAsync( + resourceGroupName, azureResourceName, privateEndpointName, privateEndpointConnection) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return createAsync(resourceGroupName, azureResourceName, privateEndpointName, privateEndpointConnection) + .block(); + } + + /** + * Updates the status of Private Endpoint Connection object. Used to approve or reject a connection. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param privateEndpointConnection Private endpoint connection object to update. + * @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 privateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String azureResourceName, + String privateEndpointName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return createWithResponseAsync( + resourceGroupName, azureResourceName, privateEndpointName, privateEndpointConnection, context) + .block(); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateEndpointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, azureResourceName, privateEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, azureResourceName, privateEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + return beginDeleteAsync(resourceGroupName, azureResourceName, privateEndpointName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, azureResourceName, privateEndpointName, context).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String azureResourceName, String privateEndpointName) { + return beginDeleteAsync(resourceGroupName, azureResourceName, privateEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, azureResourceName, privateEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 azureResourceName, String privateEndpointName) { + deleteAsync(resourceGroupName, azureResourceName, privateEndpointName).block(); + } + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + deleteAsync(resourceGroupName, azureResourceName, privateEndpointName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync(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.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..e26c2b2007342 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpointConnection; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResource(String resourceGroupName, String azureResourceName) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, azureResourceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, azureResourceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String azureResourceName, String privateEndpointName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, azureResourceName, privateEndpointName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, azureResourceName, privateEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String azureResourceName, String privateEndpointName) { + this.serviceClient().delete(resourceGroupName, azureResourceName, privateEndpointName); + } + + public void delete( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, azureResourceName, privateEndpointName, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureResourceName = Utils.getValueFromIdByName(id, "privateLinkServicesForPowerBI"); + if (azureResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'privateLinkServicesForPowerBI'.", + id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, azureResourceName, privateEndpointName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureResourceName = Utils.getValueFromIdByName(id, "privateLinkServicesForPowerBI"); + if (azureResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'privateLinkServicesForPowerBI'.", + id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, azureResourceName, privateEndpointName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureResourceName = Utils.getValueFromIdByName(id, "privateLinkServicesForPowerBI"); + if (azureResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'privateLinkServicesForPowerBI'.", + id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, azureResourceName, privateEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureResourceName = Utils.getValueFromIdByName(id, "privateLinkServicesForPowerBI"); + if (azureResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'privateLinkServicesForPowerBI'.", + id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, azureResourceName, privateEndpointName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourceImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..0d15c331c217a --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..b1f2d8b9ed481 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkResourcesListResult; +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 { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkServicesForPowerBIClientPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResource( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI/{azureResourceName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureResourceName") String azureResourceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String azureResourceName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String azureResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceGroupName, String azureResourceName) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, azureResourceName), + nextLink -> listByResourceNextSinglePageAsync(nextLink)); + } + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceGroupName, String azureResourceName, Context context) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, azureResourceName, context), + nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource(String resourceGroupName, String azureResourceName) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, azureResourceName)); + } + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, azureResourceName, context)); + } + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String azureResourceName, String privateLinkResourceName) { + 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 (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateLinkResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String azureResourceName, String privateLinkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (azureResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter azureResourceName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureResourceName, + privateLinkResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String azureResourceName, String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, azureResourceName, privateLinkResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get( + String resourceGroupName, String azureResourceName, String privateLinkResourceName) { + return getAsync(resourceGroupName, azureResourceName, privateLinkResourceName).block(); + } + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, azureResourceName, privateLinkResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync(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.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateLinkResourcesListResult. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..ea1e44100966c --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkResource; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResource(String resourceGroupName, String azureResourceName) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, azureResourceName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, azureResourceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String azureResourceName, String privateLinkResourceName) { + PrivateLinkResourceInner inner = + this.serviceClient().get(resourceGroupName, azureResourceName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateLinkResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, azureResourceName, privateLinkResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsClientImpl.java new file mode 100644 index 0000000000000..9d35362c64deb --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsClientImpl.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServiceResourceOperationResultsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.AsyncOperationDetailInner; +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 + * PrivateLinkServiceResourceOperationResultsClient. + */ +public final class PrivateLinkServiceResourceOperationResultsClientImpl + implements PrivateLinkServiceResourceOperationResultsClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkServiceResourceOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkServiceResourceOperationResultsService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of PrivateLinkServiceResourceOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkServiceResourceOperationResultsClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy + .create( + PrivateLinkServiceResourceOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * PrivateLinkServicesForPowerBIClientPrivateLinkServiceResourceOperationResults to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface PrivateLinkServiceResourceOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync(String operationId) { + 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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync(String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AsyncOperationDetailInner> beginGetAsync( + String operationId) { + Mono>> mono = getWithResponseAsync(operationId); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AsyncOperationDetailInner.class, + AsyncOperationDetailInner.class, + Context.NONE); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AsyncOperationDetailInner> beginGetAsync( + String operationId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = getWithResponseAsync(operationId, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AsyncOperationDetailInner.class, + AsyncOperationDetailInner.class, + context); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AsyncOperationDetailInner> beginGet(String operationId) { + return beginGetAsync(operationId).getSyncPoller(); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AsyncOperationDetailInner> beginGet( + String operationId, Context context) { + return beginGetAsync(operationId, context).getSyncPoller(); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String operationId) { + return beginGetAsync(operationId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String operationId, Context context) { + return beginGetAsync(operationId, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AsyncOperationDetailInner get(String operationId) { + return getAsync(operationId).block(); + } + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AsyncOperationDetailInner get(String operationId, Context context) { + return getAsync(operationId, context).block(); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsImpl.java new file mode 100644 index 0000000000000..e54e7771c6be6 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServiceResourceOperationResultsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServiceResourceOperationResultsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.AsyncOperationDetailInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.AsyncOperationDetail; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkServiceResourceOperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkServiceResourceOperationResultsImpl + implements PrivateLinkServiceResourceOperationResults { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(PrivateLinkServiceResourceOperationResultsImpl.class); + + private final PrivateLinkServiceResourceOperationResultsClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public PrivateLinkServiceResourceOperationResultsImpl( + PrivateLinkServiceResourceOperationResultsClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AsyncOperationDetail get(String operationId) { + AsyncOperationDetailInner inner = this.serviceClient().get(operationId); + if (inner != null) { + return new AsyncOperationDetailImpl(inner, this.manager()); + } else { + return null; + } + } + + public AsyncOperationDetail get(String operationId, Context context) { + AsyncOperationDetailInner inner = this.serviceClient().get(operationId, context); + if (inner != null) { + return new AsyncOperationDetailImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkServiceResourceOperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesClientImpl.java new file mode 100644 index 0000000000000..a84482676322b --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesClientImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkServicesClient. */ +public final class PrivateLinkServicesClientImpl implements PrivateLinkServicesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkServicesService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of PrivateLinkServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkServicesClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy.create(PrivateLinkServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkServicesForPowerBIClientPrivateLinkServices to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface PrivateLinkServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI" + + "/privateLinkServicesForPowerBI") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByResourceGroupWithResponseAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByResourceGroupWithResponseAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithResponseAsync(resourceGroupName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listByResourceGroup(String resourceGroupName) { + return listByResourceGroupAsync(resourceGroupName).block(); + } + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + return listByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientBuilder.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientBuilder.java new file mode 100644 index 0000000000000..713c9df213199 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientBuilder.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the PrivateLinkServicesForPowerBIClientImpl type. */ +@ServiceClientBuilder(serviceClients = {PrivateLinkServicesForPowerBIClientImpl.class}) +public final class PrivateLinkServicesForPowerBIClientBuilder { + /* + * The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + */ + private String subscriptionId; + + /** + * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @param subscriptionId the subscriptionId value. + * @return the PrivateLinkServicesForPowerBIClientBuilder. + */ + public PrivateLinkServicesForPowerBIClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the PrivateLinkServicesForPowerBIClientBuilder. + */ + public PrivateLinkServicesForPowerBIClientBuilder 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 PrivateLinkServicesForPowerBIClientBuilder. + */ + public PrivateLinkServicesForPowerBIClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the PrivateLinkServicesForPowerBIClientBuilder. + */ + public PrivateLinkServicesForPowerBIClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the PrivateLinkServicesForPowerBIClientBuilder. + */ + public PrivateLinkServicesForPowerBIClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the PrivateLinkServicesForPowerBIClientBuilder. + */ + public PrivateLinkServicesForPowerBIClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of PrivateLinkServicesForPowerBIClientImpl with the provided parameters. + * + * @return an instance of PrivateLinkServicesForPowerBIClientImpl. + */ + public PrivateLinkServicesForPowerBIClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + PrivateLinkServicesForPowerBIClientImpl client = + new PrivateLinkServicesForPowerBIClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientImpl.java new file mode 100644 index 0000000000000..1503952e5a030 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIClientImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.OperationsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PowerBIResourcesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServiceResourceOperationResultsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServicesForPowerBIClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.PrivateLinkServicesForPowerBIsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the PrivateLinkServicesForPowerBIClientImpl type. */ +@ServiceClient(builder = PrivateLinkServicesForPowerBIClientBuilder.class) +public final class PrivateLinkServicesForPowerBIClientImpl implements PrivateLinkServicesForPowerBIClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkServicesForPowerBIClientImpl.class); + + /** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + private final String subscriptionId; + + /** + * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The PrivateLinkServicesForPowerBIsClient object to access its operations. */ + private final PrivateLinkServicesForPowerBIsClient privateLinkServicesForPowerBIs; + + /** + * Gets the PrivateLinkServicesForPowerBIsClient object to access its operations. + * + * @return the PrivateLinkServicesForPowerBIsClient object. + */ + public PrivateLinkServicesForPowerBIsClient getPrivateLinkServicesForPowerBIs() { + return this.privateLinkServicesForPowerBIs; + } + + /** The PrivateLinkServiceResourceOperationResultsClient object to access its operations. */ + private final PrivateLinkServiceResourceOperationResultsClient privateLinkServiceResourceOperationResults; + + /** + * Gets the PrivateLinkServiceResourceOperationResultsClient object to access its operations. + * + * @return the PrivateLinkServiceResourceOperationResultsClient object. + */ + public PrivateLinkServiceResourceOperationResultsClient getPrivateLinkServiceResourceOperationResults() { + return this.privateLinkServiceResourceOperationResults; + } + + /** The PrivateLinkServicesClient object to access its operations. */ + private final PrivateLinkServicesClient privateLinkServices; + + /** + * Gets the PrivateLinkServicesClient object to access its operations. + * + * @return the PrivateLinkServicesClient object. + */ + public PrivateLinkServicesClient getPrivateLinkServices() { + return this.privateLinkServices; + } + + /** The PowerBIResourcesClient object to access its operations. */ + private final PowerBIResourcesClient powerBIResources; + + /** + * Gets the PowerBIResourcesClient object to access its operations. + * + * @return the PowerBIResourcesClient object. + */ + public PowerBIResourcesClient getPowerBIResources() { + return this.powerBIResources; + } + + /** 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 PrivateLinkServicesForPowerBIClient 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 Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @param endpoint server parameter. + */ + PrivateLinkServicesForPowerBIClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-06-01"; + this.operations = new OperationsClientImpl(this); + this.privateLinkServicesForPowerBIs = new PrivateLinkServicesForPowerBIsClientImpl(this); + this.privateLinkServiceResourceOperationResults = + new PrivateLinkServiceResourceOperationResultsClientImpl(this); + this.privateLinkServices = new PrivateLinkServicesClientImpl(this); + this.powerBIResources = new PowerBIResourcesClientImpl(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) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsClientImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsClientImpl.java new file mode 100644 index 0000000000000..d251dcb367a97 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsClientImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PrivateLinkServicesForPowerBIsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkServicesForPowerBIsClient. */ +public final class PrivateLinkServicesForPowerBIsClientImpl implements PrivateLinkServicesForPowerBIsClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkServicesForPowerBIsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkServicesForPowerBIsService service; + + /** The service client containing this operation class. */ + private final PrivateLinkServicesForPowerBIClientImpl client; + + /** + * Initializes an instance of PrivateLinkServicesForPowerBIsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkServicesForPowerBIsClientImpl(PrivateLinkServicesForPowerBIClientImpl client) { + this.service = + RestProxy + .create( + PrivateLinkServicesForPowerBIsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkServicesForPowerBIClientPrivateLinkServicesForPowerBIs to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PrivateLinkServicesF") + private interface PrivateLinkServicesForPowerBIsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/privateLinkServicesForPowerBI") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listBySubscriptionId( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the private link resources for the given subscription id. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listBySubscriptionIdWithResponseAsync() { + 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 + .listBySubscriptionId( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the private link resources for the given subscription id. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listBySubscriptionIdWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionId( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets all the private link resources for the given subscription id. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionIdAsync() { + return listBySubscriptionIdWithResponseAsync() + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all the private link resources for the given subscription id. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listBySubscriptionId() { + return listBySubscriptionIdAsync().block(); + } + + /** + * Gets all the private link resources for the given subscription id. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listBySubscriptionIdWithResponse(Context context) { + return listBySubscriptionIdWithResponseAsync(context).block(); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsImpl.java new file mode 100644 index 0000000000000..4c4dea85587da --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesForPowerBIsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PrivateLinkServicesForPowerBIsClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkServicesForPowerBIs; +import com.azure.resourcemanager.powerbiprivatelinks.models.TenantResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkServicesForPowerBIsImpl implements PrivateLinkServicesForPowerBIs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicesForPowerBIsImpl.class); + + private final PrivateLinkServicesForPowerBIsClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public PrivateLinkServicesForPowerBIsImpl( + PrivateLinkServicesForPowerBIsClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List listBySubscriptionId() { + List inner = this.serviceClient().listBySubscriptionId(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new TenantResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listBySubscriptionIdWithResponse(Context context) { + Response> inner = this.serviceClient().listBySubscriptionIdWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new TenantResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private PrivateLinkServicesForPowerBIsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesImpl.java new file mode 100644 index 0000000000000..1fa566ec053fd --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/PrivateLinkServicesImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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.powerbiprivatelinks.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateLinkServices; +import com.azure.resourcemanager.powerbiprivatelinks.models.TenantResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkServicesImpl implements PrivateLinkServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicesImpl.class); + + private final PrivateLinkServicesClient innerClient; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public PrivateLinkServicesImpl( + PrivateLinkServicesClient innerClient, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List listByResourceGroup(String resourceGroupName) { + List inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new TenantResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listByResourceGroupWithResponse(String resourceGroupName, Context context) { + Response> inner = + this.serviceClient().listByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new TenantResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private PrivateLinkServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/TenantResourceImpl.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/TenantResourceImpl.java new file mode 100644 index 0000000000000..afb1950df45af --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/TenantResourceImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import com.azure.resourcemanager.powerbiprivatelinks.models.PrivateEndpointConnection; +import com.azure.resourcemanager.powerbiprivatelinks.models.TenantResource; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class TenantResourceImpl implements TenantResource, TenantResource.Definition, TenantResource.Update { + private TenantResourceInner innerObject; + + private final com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public TenantResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String azureResourceName; + + private String createClientTenantId; + + private String updateClientTenantId; + + public TenantResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public TenantResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getPowerBIResources() + .createWithResponse( + resourceGroupName, azureResourceName, this.innerModel(), createClientTenantId, Context.NONE) + .getValue(); + return this; + } + + public TenantResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPowerBIResources() + .createWithResponse( + resourceGroupName, azureResourceName, this.innerModel(), createClientTenantId, context) + .getValue(); + return this; + } + + TenantResourceImpl( + String name, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerObject = new TenantResourceInner(); + this.serviceManager = serviceManager; + this.azureResourceName = name; + this.createClientTenantId = null; + } + + public TenantResourceImpl update() { + this.updateClientTenantId = null; + return this; + } + + public TenantResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPowerBIResources() + .updateWithResponse( + resourceGroupName, azureResourceName, this.innerModel(), updateClientTenantId, Context.NONE) + .getValue(); + return this; + } + + public TenantResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPowerBIResources() + .updateWithResponse( + resourceGroupName, azureResourceName, this.innerModel(), updateClientTenantId, context) + .getValue(); + return this; + } + + TenantResourceImpl( + TenantResourceInner innerObject, + com.azure.resourcemanager.powerbiprivatelinks.PrivateLinkServicesForPowerBIManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.azureResourceName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkServicesForPowerBI"); + } + + public TenantResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public TenantResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public TenantResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public TenantResourceImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public TenantResourceImpl withPrivateEndpointConnections( + List privateEndpointConnections) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + public TenantResourceImpl withClientTenantId(String clientTenantId) { + if (isInCreateMode()) { + this.createClientTenantId = clientTenantId; + return this; + } else { + this.updateClientTenantId = clientTenantId; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/Utils.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/Utils.java new file mode 100644 index 0000000000000..70edc34841a97 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/package-info.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/implementation/package-info.java new file mode 100644 index 0000000000000..1292ae28f39fa --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/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 PrivateLinkServicesForPowerBIClient. Client to manage Power BI Private + * Link Service resources and connection members. + */ +package com.azure.resourcemanager.powerbiprivatelinks.implementation; diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ActionType.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ActionType.java new file mode 100644 index 0000000000000..06e5f5dc0f57d --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/AsyncOperationDetail.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/AsyncOperationDetail.java new file mode 100644 index 0000000000000..0892b3009b63a --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/AsyncOperationDetail.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.AsyncOperationDetailInner; + +/** An immutable client-side representation of AsyncOperationDetail. */ +public interface AsyncOperationDetail { + /** + * Gets the id property: The operation id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: The operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTime property: The operation start time. + * + * @return the startTime value. + */ + String startTime(); + + /** + * Gets the endTime property: The operation end time. + * + * @return the endTime value. + */ + String endTime(); + + /** + * Gets the error property: The error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the inner com.azure.resourcemanager.powerbiprivatelinks.fluent.models.AsyncOperationDetailInner object. + * + * @return the inner object. + */ + AsyncOperationDetailInner innerModel(); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ConnectionState.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ConnectionState.java new file mode 100644 index 0000000000000..1d70fbc3ead07 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ConnectionState.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ConnectionState information. */ +@Fluent +public final class ConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionState.class); + + /* + * Status of the connection. + */ + @JsonProperty(value = "status") + private PersistedConnectionStatus status; + + /* + * Description of the connection state. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Actions required (if any). + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Status of the connection. + * + * @return the status value. + */ + public PersistedConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the connection. + * + * @param status the status value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withStatus(PersistedConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: Description of the connection state. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the connection state. + * + * @param description the description value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: Actions required (if any). + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: Actions required (if any). + * + * @param actionsRequired the actionsRequired value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operation.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operation.java new file mode 100644 index 0000000000000..f31cd62fa2200 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationDisplay.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationDisplay.java new file mode 100644 index 0000000000000..218f348422467 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationDisplay.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationListResult.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationListResult.java new file mode 100644 index 0000000000000..4783522ff4bd4 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/OperationListResult.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.powerbiprivatelinks.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operations.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operations.java new file mode 100644 index 0000000000000..ba58e04d13878 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Power BI RP operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + PagedIterable list(); + + /** + * Lists all of the available Power BI RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + PagedIterable list(Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Origin.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Origin.java new file mode 100644 index 0000000000000..21a4e3867733d --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/Origin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PersistedConnectionStatus.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PersistedConnectionStatus.java new file mode 100644 index 0000000000000..e0e58c5b14b53 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PersistedConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PersistedConnectionStatus. */ +public final class PersistedConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PersistedConnectionStatus. */ + public static final PersistedConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PersistedConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PersistedConnectionStatus. + */ + @JsonCreator + public static PersistedConnectionStatus fromString(String name) { + return fromString(name, PersistedConnectionStatus.class); + } + + /** @return known PersistedConnectionStatus values. */ + public static Collection values() { + return values(PersistedConnectionStatus.class); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PowerBIResources.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PowerBIResources.java new file mode 100644 index 0000000000000..9373d5b59d879 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PowerBIResources.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of PowerBIResources. */ +public interface PowerBIResources { + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + List getByResourceGroup(String resourceGroupName, String azureResourceName); + + /** + * Gets all the private link resources for the given Azure resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 all the private link resources for the given Azure resource. + */ + Response> getByResourceGroupWithResponse( + String resourceGroupName, String azureResourceName, Context context); + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 deleteByResourceGroup(String resourceGroupName, String azureResourceName); + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 response. + */ + Response deleteWithResponse(String resourceGroupName, String azureResourceName, Context context); + + /** + * Deletes a Private Link Service Resource for Power BI. + * + * @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 Link Service Resource for Power BI. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TenantResource resource. + * + * @param name resource name. + * @return the first stage of the new TenantResource definition. + */ + TenantResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpoint.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..c2c519753eeaf --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpoint.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpoint. */ +@Fluent +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * Specifies the id of private endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Specifies the id of private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Specifies the id of private endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnection.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..a3260b4ade40a --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnection.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerbiprivatelinks.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: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: PrivateEndpoint Specifies the private endpoint. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Specifies the connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + ConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.powerbiprivatelinks.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, azureResourceName. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @return the next definition stage. + */ + WithCreate withExistingPrivateLinkServicesForPowerBI(String resourceGroupName, String azureResourceName); + } + /** + * 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, + DefinitionStages.WithProvisioningState { + /** + * 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: PrivateEndpoint Specifies the private endpoint.. + * + * @param privateEndpoint PrivateEndpoint Specifies the private endpoint. + * @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: Specifies the connection state.. + * + * @param privateLinkServiceConnectionState Specifies the connection state. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ResourceProvisioningState provisioningState); + } + } + /** + * 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/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionListResult.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..381879ea07be5 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionListResult.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.powerbiprivatelinks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateEndpointConnections List of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * PrivateEndpointConnection Specifies the name of the private endpoint + * connection. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: PrivateEndpointConnection Specifies the name of the private endpoint connection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: PrivateEndpointConnection Specifies the name of the private endpoint connection. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnections.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..713b775b2a28d --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnections.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.powerbiprivatelinks.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 PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + PagedIterable listByResource(String resourceGroupName, String azureResourceName); + + /** + * Gets private endpoint connection for Power BI. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param azureResourceName The name of the powerbi 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 private endpoint connection for Power BI. + */ + PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context); + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 specific private endpoint connection for Power BI by private endpoint name. + */ + PrivateEndpointConnection get(String resourceGroupName, String azureResourceName, String privateEndpointName); + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 specific private endpoint connection for Power BI by private endpoint name. + */ + Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateEndpointName, Context context); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @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 azureResourceName, String privateEndpointName); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint name. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String azureResourceName, String privateEndpointName, Context context); + + /** + * Get a specific private endpoint connection for Power BI by private endpoint name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific private endpoint connection for Power BI by private endpoint name. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get a specific private endpoint connection for Power BI by private endpoint 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 a specific private endpoint connection for Power BI by private endpoint name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection for Power BI by private endpoint 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 for Power BI by private endpoint name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new 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/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteHeaders.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteHeaders.java new file mode 100644 index 0000000000000..d308769c34597 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteHeaders.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsDeleteHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsDeleteHeaders.class); + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteResponse.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteResponse.java new file mode 100644 index 0000000000000..c8bfb3791085f --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateEndpointConnectionsDeleteResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class PrivateEndpointConnectionsDeleteResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsDeleteResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + PrivateEndpointConnectionsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResource.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..3b95a332be3c6 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResource.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified identifier of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * 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.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResources.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..dd57bd449b40b --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResources.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.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 PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + PagedIterable listByResource(String resourceGroupName, String azureResourceName); + + /** + * List private link resources under a specific Power BI resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of 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 privateLinkResourcesListResult. + */ + PagedIterable listByResource( + String resourceGroupName, String azureResourceName, Context context); + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + PrivateLinkResource get(String resourceGroupName, String azureResourceName, String privateLinkResourceName); + + /** + * Get properties of a private link resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureResourceName The name of the Azure resource. + * @param privateLinkResourceName The name of 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 properties of a private link resource. + */ + Response getWithResponse( + String resourceGroupName, String azureResourceName, String privateLinkResourceName, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResourcesListResult.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResourcesListResult.java new file mode 100644 index 0000000000000..9e7cb58aaf743 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkResourcesListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLinkResourcesListResult Specifies list of the private link resource. */ +@Fluent +public final class PrivateLinkResourcesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesListResult.class); + + /* + * A collection of private endpoint connection resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A collection of private endpoint connection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private endpoint connection resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourcesListResult object itself. + */ + public PrivateLinkResourcesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServiceResourceOperationResults.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServiceResourceOperationResults.java new file mode 100644 index 0000000000000..c0e6d499a8b60 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServiceResourceOperationResults.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkServiceResourceOperationResults. */ +public interface PrivateLinkServiceResourceOperationResults { + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async 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 operation result of Private Link Service Resources for Power BI. + */ + AsyncOperationDetail get(String operationId); + + /** + * Gets operation result of Private Link Service Resources for Power BI. + * + * @param operationId The id of Azure async operation. + * @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 operation result of Private Link Service Resources for Power BI. + */ + AsyncOperationDetail get(String operationId, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServices.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServices.java new file mode 100644 index 0000000000000..3283dd8d0a550 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServices.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of PrivateLinkServices. */ +public interface PrivateLinkServices { + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + List listByResourceGroup(String resourceGroupName); + + /** + * Gets all the private link resources for the given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given resource group. + */ + Response> listByResourceGroupWithResponse(String resourceGroupName, Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServicesForPowerBIs.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServicesForPowerBIs.java new file mode 100644 index 0000000000000..c16f16024a104 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/PrivateLinkServicesForPowerBIs.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of PrivateLinkServicesForPowerBIs. */ +public interface PrivateLinkServicesForPowerBIs { + /** + * Gets all the private link resources for the given subscription id. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the private link resources for the given subscription id. + */ + List listBySubscriptionId(); + + /** + * Gets all the private link resources for the given subscription 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 all the private link resources for the given subscription id. + */ + Response> listBySubscriptionIdWithResponse(Context context); +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ResourceProvisioningState.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ResourceProvisioningState.java new file mode 100644 index 0000000000000..1c34a26e59fd4 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/ResourceProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceProvisioningState. */ +public final class ResourceProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ResourceProvisioningState. */ + public static final ResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ResourceProvisioningState. */ + public static final ResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ResourceProvisioningState. */ + public static final ResourceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ResourceProvisioningState. */ + public static final ResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for ResourceProvisioningState. */ + public static final ResourceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for ResourceProvisioningState. */ + public static final ResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProvisioningState. + */ + @JsonCreator + public static ResourceProvisioningState fromString(String name) { + return fromString(name, ResourceProvisioningState.class); + } + + /** @return known ResourceProvisioningState values. */ + public static Collection values() { + return values(ResourceProvisioningState.class); + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/TenantResource.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/TenantResource.java new file mode 100644 index 0000000000000..0e5df6f468d75 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/TenantResource.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbiprivatelinks.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of TenantResource. */ +public interface TenantResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the tenantId property: Specifies the tenant id of the resource. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the privateEndpointConnections property: Specifies the private endpoint connections of the resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.powerbiprivatelinks.fluent.models.TenantResourceInner object. + * + * @return the inner object. + */ + TenantResourceInner innerModel(); + + /** The entirety of the TenantResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The TenantResource definition stages. */ + interface DefinitionStages { + /** The first stage of the TenantResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the TenantResource 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 TenantResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the TenantResource 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.WithTenantId, + DefinitionStages.WithPrivateEndpointConnections, + DefinitionStages.WithClientTenantId { + /** + * Executes the create request. + * + * @return the created resource. + */ + TenantResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TenantResource create(Context context); + } + /** The stage of the TenantResource 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 TenantResource definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: Specifies the tenant id of the resource.. + * + * @param tenantId Specifies the tenant id of the resource. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the TenantResource definition allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: Specifies the private endpoint connections of the + * resource.. + * + * @param privateEndpointConnections Specifies the private endpoint connections of the resource. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the TenantResource definition allowing to specify clientTenantId. */ + interface WithClientTenantId { + /** + * Specifies the clientTenantId property: The client tenant id in header. This is a GUID-formatted string + * (e.g. 00000000-0000-0000-0000-000000000000).. + * + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @return the next definition stage. + */ + WithCreate withClientTenantId(String clientTenantId); + } + } + /** + * Begins update for the TenantResource resource. + * + * @return the stage of resource update. + */ + TenantResource.Update update(); + + /** The template for TenantResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithTenantId, + UpdateStages.WithPrivateEndpointConnections, + UpdateStages.WithClientTenantId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TenantResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TenantResource apply(Context context); + } + /** The TenantResource update stages. */ + interface UpdateStages { + /** The stage of the TenantResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the TenantResource update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: Specifies the tenant id of the resource.. + * + * @param tenantId Specifies the tenant id of the resource. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the TenantResource update allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: Specifies the private endpoint connections of the + * resource.. + * + * @param privateEndpointConnections Specifies the private endpoint connections of the resource. + * @return the next definition stage. + */ + Update withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the TenantResource update allowing to specify clientTenantId. */ + interface WithClientTenantId { + /** + * Specifies the clientTenantId property: The client tenant id in header. This is a GUID-formatted string + * (e.g. 00000000-0000-0000-0000-000000000000).. + * + * @param clientTenantId The client tenant id in header. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000). + * @return the next definition stage. + */ + Update withClientTenantId(String clientTenantId); + } + } +} diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/package-info.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/models/package-info.java new file mode 100644 index 0000000000000..c52218cbd72ba --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/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 PrivateLinkServicesForPowerBIClient. Client to manage Power BI Private Link + * Service resources and connection members. + */ +package com.azure.resourcemanager.powerbiprivatelinks.models; diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/package-info.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/package-info.java new file mode 100644 index 0000000000000..f5b411646030f --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/com/azure/resourcemanager/powerbiprivatelinks/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 PrivateLinkServicesForPowerBIClient. Client to manage Power BI Private Link + * Service resources and connection members. + */ +package com.azure.resourcemanager.powerbiprivatelinks; diff --git a/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/module-info.java b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/module-info.java new file mode 100644 index 0000000000000..3626b9a34cb93 --- /dev/null +++ b/sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.powerbiprivatelinks { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.powerbiprivatelinks; + exports com.azure.resourcemanager.powerbiprivatelinks.fluent; + exports com.azure.resourcemanager.powerbiprivatelinks.fluent.models; + exports com.azure.resourcemanager.powerbiprivatelinks.models; + + opens com.azure.resourcemanager.powerbiprivatelinks.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.powerbiprivatelinks.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/powerbiprivatelinks/ci.yml b/sdk/powerbiprivatelinks/ci.yml new file mode 100644 index 0000000000000..0ae2933ca7015 --- /dev/null +++ b/sdk/powerbiprivatelinks/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/powerbiprivatelinks/ci.yml + - sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/ + exclude: + - sdk/powerbiprivatelinks/pom.xml + - sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbiprivatelinks/ci.yml + - sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/ + exclude: + - sdk/powerbiprivatelinks/pom.xml + - sdk/powerbiprivatelinks/azure-resourcemanager-powerbiprivatelinks/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: powerbiprivatelinks + Artifacts: + - name: azure-resourcemanager-powerbiprivatelinks + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerpowerbiprivatelinks diff --git a/sdk/powerbiprivatelinks/pom.xml b/sdk/powerbiprivatelinks/pom.xml new file mode 100644 index 0000000000000..7062699ddd21f --- /dev/null +++ b/sdk/powerbiprivatelinks/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-powerbiprivatelinks-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-powerbiprivatelinks + + + +