diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e81b6ef0c200..23825621cc1c 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -350,6 +350,7 @@ com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-deviceupdate;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-machinelearning;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-education;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-powerplatform;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 28f19ed8c5ca..3e6f56726f62 100644 --- a/pom.xml +++ b/pom.xml @@ -949,6 +949,7 @@ sdk/postgresql sdk/postgresqlflexibleserver sdk/powerbidedicated + sdk/powerplatform sdk/purview sdk/quantum sdk/quota diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/CHANGELOG.md b/sdk/powerplatform/azure-resourcemanager-powerplatform/CHANGELOG.md new file mode 100644 index 000000000000..4d74c12a75b7 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-06-10) + +- Azure Resource Manager PowerPlatform client library for Java. This package contains Microsoft Azure SDK for PowerPlatform Management SDK. Package tag package-2020-10-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/README.md b/sdk/powerplatform/azure-resourcemanager-powerplatform/README.md new file mode 100644 index 000000000000..ae364a10bd33 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager PowerPlatform client library for Java + +Azure Resource Manager PowerPlatform client library for Java. + +This package contains Microsoft Azure SDK for PowerPlatform Management SDK. Package tag package-2020-10-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-powerplatform;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-powerplatform + 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(); +PowerPlatformManager manager = PowerPlatformManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/powerplatform/azure-resourcemanager-powerplatform/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/SAMPLE.md b/sdk/powerplatform/azure-resourcemanager-powerplatform/SAMPLE.md new file mode 100644 index 000000000000..0f57e841ecec --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/SAMPLE.md @@ -0,0 +1,545 @@ +# Code snippets and samples + + +## Accounts + +- [CreateOrUpdate](#accounts_createorupdate) +- [Delete](#accounts_delete) +- [GetByResourceGroup](#accounts_getbyresourcegroup) +- [List](#accounts_list) +- [ListByResourceGroup](#accounts_listbyresourcegroup) +- [Update](#accounts_update) + +## EnterprisePolicies + +- [CreateOrUpdate](#enterprisepolicies_createorupdate) +- [Delete](#enterprisepolicies_delete) +- [GetByResourceGroup](#enterprisepolicies_getbyresourcegroup) +- [List](#enterprisepolicies_list) +- [ListByResourceGroup](#enterprisepolicies_listbyresourcegroup) +- [Update](#enterprisepolicies_update) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByEnterprisePolicy](#privateendpointconnections_listbyenterprisepolicy) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByEnterprisePolicy](#privatelinkresources_listbyenterprisepolicy) +### Accounts_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts CreateOrUpdate. */ +public final class AccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/createOrUpdateAccount.json + */ + /** + * Sample code: Create or update account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void createOrUpdateAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .accounts() + .define("account") + .withRegion("East US") + .withExistingResourceGroup("resourceGroup") + .withTags(mapOf("Organization", "Administration")) + .withDescription("Description of the account.") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Accounts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts Delete. */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/deleteAccount.json + */ + /** + * Sample code: Delete account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void deleteAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().deleteWithResponse("resourceGroup", "account", Context.NONE); + } +} +``` + +### Accounts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts GetByResourceGroup. */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/getAccount.json + */ + /** + * Sample code: Get account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().getByResourceGroupWithResponse("rg", "account", Context.NONE); + } +} +``` + +### Accounts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts List. */ +public final class AccountsListSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listAccountsBySubscription.json + */ + /** + * Sample code: List accounts by subscription. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listAccountsBySubscription( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().list(Context.NONE); + } +} +``` + +### Accounts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Accounts ListByResourceGroup. */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listAccountsByResourceGroup.json + */ + /** + * Sample code: List accounts by resource group. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listAccountsByResourceGroup( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().listByResourceGroup("rg", Context.NONE); + } +} +``` + +### Accounts_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.models.Account; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Update. */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/updateAccount.json + */ + /** + * Sample code: Update account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void updateAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + Account resource = + manager.accounts().getByResourceGroupWithResponse("resourceGroup", "account", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("Organization", "Administration")) + .withDescription("Description of account.") + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### EnterprisePolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyIdentity; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyKind; +import com.azure.resourcemanager.powerplatform.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for EnterprisePolicies CreateOrUpdate. */ +public final class EnterprisePoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/createOrUpdateEnterprisePolicy.json + */ + /** + * Sample code: Create or update EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void createOrUpdateEnterprisePolicy( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .enterprisePolicies() + .define("enterprisePolicy") + .withRegion("East US") + .withExistingResourceGroup("resourceGroup") + .withKind(EnterprisePolicyKind.LOCKBOX) + .withTags(mapOf("Organization", "Administration")) + .withIdentity(new EnterprisePolicyIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### EnterprisePolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies Delete. */ +public final class EnterprisePoliciesDeleteSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/deleteEnterprisePolicy.json + */ + /** + * Sample code: Delete an EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void deleteAnEnterprisePolicy(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().deleteWithResponse("resourceGroup", "enterprisePolicy", Context.NONE); + } +} +``` + +### EnterprisePolicies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies GetByResourceGroup. */ +public final class EnterprisePoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/getEnterprisePolicy.json + */ + /** + * Sample code: Get an EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getAnEnterprisePolicy(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().getByResourceGroupWithResponse("rg", "enterprisePolicy", Context.NONE); + } +} +``` + +### EnterprisePolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies List. */ +public final class EnterprisePoliciesListSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listEnterprisePoliciesBySubscription.json + */ + /** + * Sample code: List EnterprisePolicies by subscription. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listEnterprisePoliciesBySubscription( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().list(Context.NONE); + } +} +``` + +### EnterprisePolicies_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies ListByResourceGroup. */ +public final class EnterprisePoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listEnterprisePoliciesByResourceGroup.json + */ + /** + * Sample code: List EnterprisePolicies by resource group. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listEnterprisePoliciesByResourceGroup( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### EnterprisePolicies_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicy; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyIdentity; +import com.azure.resourcemanager.powerplatform.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for EnterprisePolicies Update. */ +public final class EnterprisePoliciesUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/updateEnterprisePolicy.json + */ + /** + * Sample code: Update EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void updateEnterprisePolicy(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + EnterprisePolicy resource = + manager + .enterprisePolicies() + .getByResourceGroupWithResponse("resourceGroup", "enterprisePolicy", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("Organization", "Administration")) + .withIdentity(new EnterprisePolicyIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listOperations.json + */ + /** + * Sample code: Lists all of the available PowerPlatform REST API operations. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listsAllOfTheAvailablePowerPlatformRESTAPIOperations( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .privateEndpointConnections() + .define("privateEndpointConnectionName") + .withExistingEnterprisePolicy("rg1", "ddb1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateEndpointConnections().delete("rg1", "ddb1", "privateEndpointConnectionName", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("rg1", "ddb1", "privateEndpointConnectionName", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByEnterprisePolicy + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByEnterprisePolicy. */ +public final class PrivateEndpointConnectionsListByEnterprisePolicySamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateEndpointConnections().listByEnterprisePolicy("rg1", "ddb1", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateLinkResources().getWithResponse("rg1", "ddb1", "sql", Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByEnterprisePolicy + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByEnterprisePolicy. */ +public final class PrivateLinkResourcesListByEnterprisePolicySamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateLinkResources().listByEnterprisePolicy("rg1", "ddb1", Context.NONE); + } +} +``` + diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/pom.xml b/sdk/powerplatform/azure-resourcemanager-powerplatform/pom.xml new file mode 100644 index 000000000000..710fe74e96cd --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-powerplatform + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for PowerPlatform Management + This package contains Microsoft Azure SDK for PowerPlatform Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2020-10-30-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.29.1 + + + com.azure + azure-core-management + 1.6.2 + + + diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/PowerPlatformManager.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/PowerPlatformManager.java new file mode 100644 index 000000000000..1935d8f57d63 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/PowerPlatformManager.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerplatform.fluent.PowerPlatform; +import com.azure.resourcemanager.powerplatform.implementation.AccountsImpl; +import com.azure.resourcemanager.powerplatform.implementation.EnterprisePoliciesImpl; +import com.azure.resourcemanager.powerplatform.implementation.OperationsImpl; +import com.azure.resourcemanager.powerplatform.implementation.PowerPlatformBuilder; +import com.azure.resourcemanager.powerplatform.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.powerplatform.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.powerplatform.models.Accounts; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicies; +import com.azure.resourcemanager.powerplatform.models.Operations; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnections; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkResources; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to PowerPlatformManager. */ +public final class PowerPlatformManager { + private Accounts accounts; + + private EnterprisePolicies enterprisePolicies; + + private Operations operations; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private final PowerPlatform clientObject; + + private PowerPlatformManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new PowerPlatformBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of PowerPlatform service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PowerPlatform service API instance. + */ + public static PowerPlatformManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of PowerPlatform service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the PowerPlatform service API instance. + */ + public static PowerPlatformManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new PowerPlatformManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create PowerPlatformManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new PowerPlatformManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of PowerPlatform service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the PowerPlatform service API instance. + */ + public PowerPlatformManager 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.powerplatform") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new PowerPlatformManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Accounts. It manages Account. + * + * @return Resource collection API of Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(clientObject.getAccounts(), this); + } + return accounts; + } + + /** + * Gets the resource collection API of EnterprisePolicies. It manages EnterprisePolicy. + * + * @return Resource collection API of EnterprisePolicies. + */ + public EnterprisePolicies enterprisePolicies() { + if (this.enterprisePolicies == null) { + this.enterprisePolicies = new EnterprisePoliciesImpl(clientObject.getEnterprisePolicies(), this); + } + return enterprisePolicies; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * @return Wrapped service client PowerPlatform providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public PowerPlatform serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/AccountsClient.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/AccountsClient.java new file mode 100644 index 000000000000..cc1f2befedd3 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/AccountsClient.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.models.AccountInner; +import com.azure.resourcemanager.powerplatform.models.PatchAccount; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public interface AccountsClient { + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @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 definition of the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner createOrUpdate(String accountName, String resourceGroupName, AccountInner parameters); + + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @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 definition of the account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String accountName, String resourceGroupName, AccountInner parameters, Context context); + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 information about an account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 information about an account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 accountName); + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @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 definition of the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner update(String accountName, String resourceGroupName, PatchAccount parameters); + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @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 definition of the account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String accountName, String resourceGroupName, PatchAccount parameters, Context context); + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve a list of accounts within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieve a list of accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/EnterprisePoliciesClient.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/EnterprisePoliciesClient.java new file mode 100644 index 000000000000..d83d54dd38e4 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/EnterprisePoliciesClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.models.EnterprisePolicyInner; +import com.azure.resourcemanager.powerplatform.models.PatchEnterprisePolicy; + +/** An instance of this class provides access to all the operations defined in EnterprisePoliciesClient. */ +public interface EnterprisePoliciesClient { + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @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 definition of the EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnterprisePolicyInner createOrUpdate( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters); + + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @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 definition of the EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters, Context context); + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnterprisePolicyInner getByResourceGroup(String resourceGroupName, String enterprisePolicyName); + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @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 enterprisePolicyName); + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @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 definition of the EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnterprisePolicyInner update( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters); + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @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 definition of the EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters, Context context); + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/OperationsClient.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/OperationsClient.java new file mode 100644 index 000000000000..5de9d2a1492c --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.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 PowerPlatform REST API 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available PowerPlatform REST API 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PowerPlatform.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PowerPlatform.java new file mode 100644 index 000000000000..990ab6735e51 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PowerPlatform.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for PowerPlatform class. */ +public interface PowerPlatform { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + AccountsClient getAccounts(); + + /** + * Gets the EnterprisePoliciesClient object to access its operations. + * + * @return the EnterprisePoliciesClient object. + */ + EnterprisePoliciesClient getEnterprisePolicies(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PrivateEndpointConnectionsClient.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..fd7dda0e472b --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @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 private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName); + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 enterprisePolicyName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 enterprisePolicyName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PrivateLinkResourcesClient.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..1833c4d6869f --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName); + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String enterprisePolicyName, String groupName); + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String groupName, Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/AccountInner.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/AccountInner.java new file mode 100644 index 000000000000..b7ea4666fd4f --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/AccountInner.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.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Definition of the account. */ +@Fluent +public final class AccountInner extends Resource { + /* + * The properties that define configuration for the account. + */ + @JsonProperty(value = "properties") + private AccountProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties that define configuration for the account. + * + * @return the innerProperties value. + */ + private AccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public AccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: The description of the account. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the account. + * + * @param description the description value to set. + * @return the AccountInner object itself. + */ + public AccountInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/AccountProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/AccountProperties.java new file mode 100644 index 000000000000..f3d3db989406 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/AccountProperties.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.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define configuration for the account. */ +@Fluent +public final class AccountProperties { + /* + * The description of the account. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the description property: The description of the account. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the account. + * + * @param description the description value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/EnterprisePolicyInner.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/EnterprisePolicyInner.java new file mode 100644 index 000000000000..77e024ee7f5e --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/EnterprisePolicyInner.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.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyIdentity; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyKind; +import com.azure.resourcemanager.powerplatform.models.PropertiesEncryption; +import com.azure.resourcemanager.powerplatform.models.PropertiesLockbox; +import com.azure.resourcemanager.powerplatform.models.PropertiesNetworkInjection; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Definition of the EnterprisePolicy. */ +@Fluent +public final class EnterprisePolicyInner extends Resource { + /* + * The identity of the EnterprisePolicy. + */ + @JsonProperty(value = "identity") + private EnterprisePolicyIdentity identity; + + /* + * The kind (type) of Enterprise Policy. + */ + @JsonProperty(value = "kind", required = true) + private EnterprisePolicyKind kind; + + /* + * The properties that define configuration for the enterprise policy + */ + @JsonProperty(value = "properties") + private Properties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the identity property: The identity of the EnterprisePolicy. + * + * @return the identity value. + */ + public EnterprisePolicyIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the EnterprisePolicy. + * + * @param identity the identity value to set. + * @return the EnterprisePolicyInner object itself. + */ + public EnterprisePolicyInner withIdentity(EnterprisePolicyIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: The kind (type) of Enterprise Policy. + * + * @return the kind value. + */ + public EnterprisePolicyKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind (type) of Enterprise Policy. + * + * @param kind the kind value to set. + * @return the EnterprisePolicyInner object itself. + */ + public EnterprisePolicyInner withKind(EnterprisePolicyKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the innerProperties property: The properties that define configuration for the enterprise policy. + * + * @return the innerProperties value. + */ + private Properties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public EnterprisePolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public EnterprisePolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the lockbox property: Settings concerning lockbox. + * + * @return the lockbox value. + */ + public PropertiesLockbox lockbox() { + return this.innerProperties() == null ? null : this.innerProperties().lockbox(); + } + + /** + * Set the lockbox property: Settings concerning lockbox. + * + * @param lockbox the lockbox value to set. + * @return the EnterprisePolicyInner object itself. + */ + public EnterprisePolicyInner withLockbox(PropertiesLockbox lockbox) { + if (this.innerProperties() == null) { + this.innerProperties = new Properties(); + } + this.innerProperties().withLockbox(lockbox); + return this; + } + + /** + * Get the encryption property: The encryption settings for a configuration store. + * + * @return the encryption value. + */ + public PropertiesEncryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption settings for a configuration store. + * + * @param encryption the encryption value to set. + * @return the EnterprisePolicyInner object itself. + */ + public EnterprisePolicyInner withEncryption(PropertiesEncryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new Properties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkInjection property: Settings concerning network injection. + * + * @return the networkInjection value. + */ + public PropertiesNetworkInjection networkInjection() { + return this.innerProperties() == null ? null : this.innerProperties().networkInjection(); + } + + /** + * Set the networkInjection property: Settings concerning network injection. + * + * @param networkInjection the networkInjection value to set. + * @return the EnterprisePolicyInner object itself. + */ + public EnterprisePolicyInner withNetworkInjection(PropertiesNetworkInjection networkInjection) { + if (this.innerProperties() == null) { + this.innerProperties = new Properties(); + } + this.innerProperties().withNetworkInjection(networkInjection); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (kind() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model EnterprisePolicyInner")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EnterprisePolicyInner.class); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/OperationInner.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/OperationInner.java new file mode 100644 index 000000000000..e52c7f89173d --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/OperationInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerplatform.models.ActionType; +import com.azure.resourcemanager.powerplatform.models.OperationDisplay; +import com.azure.resourcemanager.powerplatform.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateEndpointConnectionInner.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..b9f04596c0e6 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpoint; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..264a0d5e815e --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpoint; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateLinkResourceInner.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..2a7efc340ef1 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateLinkResourceProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..0ca2ae2bf7cd --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/Properties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/Properties.java new file mode 100644 index 000000000000..7f72b7f9afff --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/Properties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerplatform.models.PropertiesEncryption; +import com.azure.resourcemanager.powerplatform.models.PropertiesLockbox; +import com.azure.resourcemanager.powerplatform.models.PropertiesNetworkInjection; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define configuration for the enterprise policy. */ +@Fluent +public final class Properties { + /* + * Settings concerning lockbox. + */ + @JsonProperty(value = "lockbox") + private PropertiesLockbox lockbox; + + /* + * The encryption settings for a configuration store. + */ + @JsonProperty(value = "encryption") + private PropertiesEncryption encryption; + + /* + * Settings concerning network injection. + */ + @JsonProperty(value = "networkInjection") + private PropertiesNetworkInjection networkInjection; + + /** + * Get the lockbox property: Settings concerning lockbox. + * + * @return the lockbox value. + */ + public PropertiesLockbox lockbox() { + return this.lockbox; + } + + /** + * Set the lockbox property: Settings concerning lockbox. + * + * @param lockbox the lockbox value to set. + * @return the Properties object itself. + */ + public Properties withLockbox(PropertiesLockbox lockbox) { + this.lockbox = lockbox; + return this; + } + + /** + * Get the encryption property: The encryption settings for a configuration store. + * + * @return the encryption value. + */ + public PropertiesEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption settings for a configuration store. + * + * @param encryption the encryption value to set. + * @return the Properties object itself. + */ + public Properties withEncryption(PropertiesEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkInjection property: Settings concerning network injection. + * + * @return the networkInjection value. + */ + public PropertiesNetworkInjection networkInjection() { + return this.networkInjection; + } + + /** + * Set the networkInjection property: Settings concerning network injection. + * + * @param networkInjection the networkInjection value to set. + * @return the Properties object itself. + */ + public Properties withNetworkInjection(PropertiesNetworkInjection networkInjection) { + this.networkInjection = networkInjection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lockbox() != null) { + lockbox().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (networkInjection() != null) { + networkInjection().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/package-info.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/package-info.java new file mode 100644 index 000000000000..e777b7be30a6 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for PowerPlatform. null. */ +package com.azure.resourcemanager.powerplatform.fluent.models; diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/package-info.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/package-info.java new file mode 100644 index 000000000000..f4b4bbdc46b3 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for PowerPlatform. null. */ +package com.azure.resourcemanager.powerplatform.fluent; diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountImpl.java new file mode 100644 index 000000000000..e30f787fde2c --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.fluent.models.AccountInner; +import com.azure.resourcemanager.powerplatform.models.Account; +import com.azure.resourcemanager.powerplatform.models.PatchAccount; +import java.util.Collections; +import java.util.Map; + +public final class AccountImpl implements Account, Account.Definition, Account.Update { + private AccountInner innerObject; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager 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 description() { + return this.innerModel().description(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } + + private String accountName; + + private String resourceGroupName; + + private PatchAccount updateParameters; + + public AccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Account create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .createOrUpdateWithResponse(accountName, resourceGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Account create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .createOrUpdateWithResponse(accountName, resourceGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + AccountImpl(String name, com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerObject = new AccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + } + + public AccountImpl update() { + this.updateParameters = new PatchAccount(); + return this; + } + + public Account apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .updateWithResponse(accountName, resourceGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Account apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .updateWithResponse(accountName, resourceGroupName, updateParameters, context) + .getValue(); + return this; + } + + AccountImpl(AccountInner innerObject, com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "accounts"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public Account refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public Account refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public AccountImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AccountImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public AccountImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountsClientImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountsClientImpl.java new file mode 100644 index 000000000000..ae1e43cc2586 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountsClientImpl.java @@ -0,0 +1,1225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.powerplatform.fluent.AccountsClient; +import com.azure.resourcemanager.powerplatform.fluent.models.AccountInner; +import com.azure.resourcemanager.powerplatform.models.AccountList; +import com.azure.resourcemanager.powerplatform.models.PatchAccount; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public final class AccountsClientImpl implements AccountsClient { + /** The proxy service used to perform REST calls. */ + private final AccountsService service; + + /** The service client containing this operation class. */ + private final PowerPlatformImpl client; + + /** + * Initializes an instance of AccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountsClientImpl(PowerPlatformImpl client) { + this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PowerPlatformAccounts to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PowerPlatformAccount") + private interface AccountsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/accounts/{accountName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("accountName") String accountName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/accounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/accounts/{accountName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/accounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("accountName") String accountName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PatchAccount parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/accounts") + @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); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PowerPlatform/accounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String accountName, String resourceGroupName, AccountInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + accountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @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 definition of the account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String accountName, String resourceGroupName, AccountInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + accountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String accountName, String resourceGroupName, AccountInner parameters) { + return createOrUpdateWithResponseAsync(accountName, resourceGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner createOrUpdate(String accountName, String resourceGroupName, AccountInner parameters) { + return createOrUpdateAsync(accountName, resourceGroupName, parameters).block(); + } + + /** + * Creates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update an account. + * @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 definition of the account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String accountName, String resourceGroupName, AccountInner parameters, Context context) { + return createOrUpdateWithResponseAsync(accountName, resourceGroupName, parameters, context).block(); + } + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 information about an account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupAsync(resourceGroupName, accountName).block(); + } + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 information about an account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + accountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 accountName) { + deleteAsync(resourceGroupName, accountName).block(); + } + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String accountName, String resourceGroupName, PatchAccount parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + accountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @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 definition of the account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String accountName, String resourceGroupName, PatchAccount parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + accountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String accountName, String resourceGroupName, PatchAccount parameters) { + return updateWithResponseAsync(accountName, resourceGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner update(String accountName, String resourceGroupName, PatchAccount parameters) { + return updateAsync(accountName, resourceGroupName, parameters).block(); + } + + /** + * Updates an account. + * + * @param accountName Name of the account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update an account. + * @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 definition of the account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String accountName, String resourceGroupName, PatchAccount parameters, Context context) { + return updateWithResponseAsync(accountName, resourceGroupName, parameters, context).block(); + } + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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())); + } + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve a list of accounts within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + 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())); + } + + /** + * Retrieve a list of accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve a list of accounts within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve a list of accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve a list of accounts within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieve a list of accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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 + .listBySubscriptionNext(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/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountsImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountsImpl.java new file mode 100644 index 000000000000..2436e0a02c1b --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/AccountsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.AccountsClient; +import com.azure.resourcemanager.powerplatform.fluent.models.AccountInner; +import com.azure.resourcemanager.powerplatform.models.Account; +import com.azure.resourcemanager.powerplatform.models.Accounts; + +public final class AccountsImpl implements Accounts { + private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class); + + private final AccountsClient innerClient; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + public AccountsImpl( + AccountsClient innerClient, com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Account getByResourceGroup(String resourceGroupName, String accountName) { + AccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new AccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public Account 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 accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, 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 accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, 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 accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, Context.NONE); + } + + 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 accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, context); + } + + private AccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } + + public AccountImpl define(String name) { + return new AccountImpl(name, this.manager()); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePoliciesClientImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePoliciesClientImpl.java new file mode 100644 index 000000000000..27e07ea4256a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePoliciesClientImpl.java @@ -0,0 +1,1241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.powerplatform.fluent.EnterprisePoliciesClient; +import com.azure.resourcemanager.powerplatform.fluent.models.EnterprisePolicyInner; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyList; +import com.azure.resourcemanager.powerplatform.models.PatchEnterprisePolicy; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EnterprisePoliciesClient. */ +public final class EnterprisePoliciesClientImpl implements EnterprisePoliciesClient { + /** The proxy service used to perform REST calls. */ + private final EnterprisePoliciesService service; + + /** The service client containing this operation class. */ + private final PowerPlatformImpl client; + + /** + * Initializes an instance of EnterprisePoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EnterprisePoliciesClientImpl(PowerPlatformImpl client) { + this.service = + RestProxy.create(EnterprisePoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PowerPlatformEnterprisePolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PowerPlatformEnterpr") + private interface EnterprisePoliciesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EnterprisePolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PatchEnterprisePolicy parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies") + @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); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PowerPlatform/enterprisePolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the EnterprisePolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + enterprisePolicyName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @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 definition of the EnterprisePolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + enterprisePolicyName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the EnterprisePolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters) { + return createOrUpdateWithResponseAsync(enterprisePolicyName, resourceGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnterprisePolicyInner createOrUpdate( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters) { + return createOrUpdateAsync(enterprisePolicyName, resourceGroupName, parameters).block(); + } + + /** + * Creates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to create or update EnterprisePolicy. + * @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 definition of the EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String enterprisePolicyName, String resourceGroupName, EnterprisePolicyInner parameters, Context context) { + return createOrUpdateWithResponseAsync(enterprisePolicyName, resourceGroupName, parameters, context).block(); + } + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String enterprisePolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + enterprisePolicyName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + enterprisePolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String enterprisePolicyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, enterprisePolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnterprisePolicyInner getByResourceGroup(String resourceGroupName, String enterprisePolicyName) { + return getByResourceGroupAsync(resourceGroupName, enterprisePolicyName).block(); + } + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String enterprisePolicyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, enterprisePolicyName, context).block(); + } + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String enterprisePolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + enterprisePolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + enterprisePolicyName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String enterprisePolicyName) { + return deleteWithResponseAsync(resourceGroupName, enterprisePolicyName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enterprisePolicyName) { + deleteAsync(resourceGroupName, enterprisePolicyName).block(); + } + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String enterprisePolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, enterprisePolicyName, context).block(); + } + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the EnterprisePolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + enterprisePolicyName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @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 definition of the EnterprisePolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + enterprisePolicyName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the EnterprisePolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters) { + return updateWithResponseAsync(enterprisePolicyName, resourceGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return definition of the EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnterprisePolicyInner update( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters) { + return updateAsync(enterprisePolicyName, resourceGroupName, parameters).block(); + } + + /** + * Updates an EnterprisePolicy. + * + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters supplied to update EnterprisePolicy. + * @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 definition of the EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String enterprisePolicyName, String resourceGroupName, PatchEnterprisePolicy parameters, Context context) { + return updateWithResponseAsync(enterprisePolicyName, resourceGroupName, parameters, context).block(); + } + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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())); + } + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + 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())); + } + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePoliciesImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePoliciesImpl.java new file mode 100644 index 000000000000..ac4bc219af25 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePoliciesImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.EnterprisePoliciesClient; +import com.azure.resourcemanager.powerplatform.fluent.models.EnterprisePolicyInner; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicies; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicy; + +public final class EnterprisePoliciesImpl implements EnterprisePolicies { + private static final ClientLogger LOGGER = new ClientLogger(EnterprisePoliciesImpl.class); + + private final EnterprisePoliciesClient innerClient; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + public EnterprisePoliciesImpl( + EnterprisePoliciesClient innerClient, + com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EnterprisePolicy getByResourceGroup(String resourceGroupName, String enterprisePolicyName) { + EnterprisePolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, enterprisePolicyName); + if (inner != null) { + return new EnterprisePolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String enterprisePolicyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, enterprisePolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EnterprisePolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String enterprisePolicyName) { + this.serviceClient().delete(resourceGroupName, enterprisePolicyName); + } + + public Response deleteWithResponse(String resourceGroupName, String enterprisePolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, enterprisePolicyName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new EnterprisePolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new EnterprisePolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new EnterprisePolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new EnterprisePolicyImpl(inner1, this.manager())); + } + + public EnterprisePolicy 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, enterprisePolicyName, 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, enterprisePolicyName, 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, enterprisePolicyName, Context.NONE); + } + + 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, enterprisePolicyName, context); + } + + private EnterprisePoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } + + public EnterprisePolicyImpl define(String name) { + return new EnterprisePolicyImpl(name, this.manager()); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePolicyImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePolicyImpl.java new file mode 100644 index 000000000000..5caa907d712a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/EnterprisePolicyImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.fluent.models.EnterprisePolicyInner; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicy; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyIdentity; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyKind; +import com.azure.resourcemanager.powerplatform.models.PatchEnterprisePolicy; +import com.azure.resourcemanager.powerplatform.models.PropertiesEncryption; +import com.azure.resourcemanager.powerplatform.models.PropertiesLockbox; +import com.azure.resourcemanager.powerplatform.models.PropertiesNetworkInjection; +import java.util.Collections; +import java.util.Map; + +public final class EnterprisePolicyImpl + implements EnterprisePolicy, EnterprisePolicy.Definition, EnterprisePolicy.Update { + private EnterprisePolicyInner innerObject; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager 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 EnterprisePolicyIdentity identity() { + return this.innerModel().identity(); + } + + public EnterprisePolicyKind kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PropertiesLockbox lockbox() { + return this.innerModel().lockbox(); + } + + public PropertiesEncryption encryption() { + return this.innerModel().encryption(); + } + + public PropertiesNetworkInjection networkInjection() { + return this.innerModel().networkInjection(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EnterprisePolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } + + private String enterprisePolicyName; + + private String resourceGroupName; + + private PatchEnterprisePolicy updateParameters; + + public EnterprisePolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EnterprisePolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getEnterprisePolicies() + .createOrUpdateWithResponse(enterprisePolicyName, resourceGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EnterprisePolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEnterprisePolicies() + .createOrUpdateWithResponse(enterprisePolicyName, resourceGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + EnterprisePolicyImpl(String name, com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerObject = new EnterprisePolicyInner(); + this.serviceManager = serviceManager; + this.enterprisePolicyName = name; + } + + public EnterprisePolicyImpl update() { + this.updateParameters = new PatchEnterprisePolicy(); + return this; + } + + public EnterprisePolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getEnterprisePolicies() + .updateWithResponse(enterprisePolicyName, resourceGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public EnterprisePolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEnterprisePolicies() + .updateWithResponse(enterprisePolicyName, resourceGroupName, updateParameters, context) + .getValue(); + return this; + } + + EnterprisePolicyImpl( + EnterprisePolicyInner innerObject, + com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.enterprisePolicyName = Utils.getValueFromIdByName(innerObject.id(), "enterprisePolicies"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public EnterprisePolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEnterprisePolicies() + .getByResourceGroupWithResponse(resourceGroupName, enterprisePolicyName, Context.NONE) + .getValue(); + return this; + } + + public EnterprisePolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEnterprisePolicies() + .getByResourceGroupWithResponse(resourceGroupName, enterprisePolicyName, context) + .getValue(); + return this; + } + + public EnterprisePolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EnterprisePolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EnterprisePolicyImpl withKind(EnterprisePolicyKind kind) { + if (isInCreateMode()) { + this.innerModel().withKind(kind); + return this; + } else { + this.updateParameters.withKind(kind); + return this; + } + } + + public EnterprisePolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public EnterprisePolicyImpl withIdentity(EnterprisePolicyIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public EnterprisePolicyImpl withLockbox(PropertiesLockbox lockbox) { + if (isInCreateMode()) { + this.innerModel().withLockbox(lockbox); + return this; + } else { + this.updateParameters.withLockbox(lockbox); + return this; + } + } + + public EnterprisePolicyImpl withEncryption(PropertiesEncryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public EnterprisePolicyImpl withNetworkInjection(PropertiesNetworkInjection networkInjection) { + if (isInCreateMode()) { + this.innerModel().withNetworkInjection(networkInjection); + return this; + } else { + this.updateParameters.withNetworkInjection(networkInjection); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationImpl.java new file mode 100644 index 000000000000..b925db46f630 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.resourcemanager.powerplatform.fluent.models.OperationInner; +import com.azure.resourcemanager.powerplatform.models.ActionType; +import com.azure.resourcemanager.powerplatform.models.Operation; +import com.azure.resourcemanager.powerplatform.models.OperationDisplay; +import com.azure.resourcemanager.powerplatform.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.powerplatform.PowerPlatformManager 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.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationsClientImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..0f5aa351f5ab --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationsClientImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.powerplatform.fluent.OperationsClient; +import com.azure.resourcemanager.powerplatform.fluent.models.OperationInner; +import com.azure.resourcemanager.powerplatform.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final PowerPlatformImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(PowerPlatformImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PowerPlatformOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PowerPlatformOperati") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.PowerPlatform/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 PowerPlatform REST API 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available PowerPlatform REST API 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available PowerPlatform REST API 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 as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available PowerPlatform REST API 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 as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available PowerPlatform REST API 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available PowerPlatform REST API 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationsImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationsImpl.java new file mode 100644 index 000000000000..9673c330c715 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.OperationsClient; +import com.azure.resourcemanager.powerplatform.fluent.models.OperationInner; +import com.azure.resourcemanager.powerplatform.models.Operation; +import com.azure.resourcemanager.powerplatform.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.powerplatform.PowerPlatformManager 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.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PowerPlatformBuilder.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PowerPlatformBuilder.java new file mode 100644 index 000000000000..50c3c223e9c1 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PowerPlatformBuilder.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.powerplatform.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the PowerPlatformImpl type. */ +@ServiceClientBuilder(serviceClients = {PowerPlatformImpl.class}) +public final class PowerPlatformBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the PowerPlatformBuilder. + */ + public PowerPlatformBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the PowerPlatformBuilder. + */ + public PowerPlatformBuilder 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 PowerPlatformBuilder. + */ + public PowerPlatformBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the PowerPlatformBuilder. + */ + public PowerPlatformBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the PowerPlatformBuilder. + */ + public PowerPlatformBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the PowerPlatformBuilder. + */ + public PowerPlatformBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of PowerPlatformImpl with the provided parameters. + * + * @return an instance of PowerPlatformImpl. + */ + public PowerPlatformImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + PowerPlatformImpl client = + new PowerPlatformImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PowerPlatformImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PowerPlatformImpl.java new file mode 100644 index 000000000000..8d3558ae9dc1 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PowerPlatformImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.powerplatform.fluent.AccountsClient; +import com.azure.resourcemanager.powerplatform.fluent.EnterprisePoliciesClient; +import com.azure.resourcemanager.powerplatform.fluent.OperationsClient; +import com.azure.resourcemanager.powerplatform.fluent.PowerPlatform; +import com.azure.resourcemanager.powerplatform.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.powerplatform.fluent.PrivateLinkResourcesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the PowerPlatformImpl type. */ +@ServiceClient(builder = PowerPlatformBuilder.class) +public final class PowerPlatformImpl implements PowerPlatform { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The AccountsClient object to access its operations. */ + private final AccountsClient accounts; + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + public AccountsClient getAccounts() { + return this.accounts; + } + + /** The EnterprisePoliciesClient object to access its operations. */ + private final EnterprisePoliciesClient enterprisePolicies; + + /** + * Gets the EnterprisePoliciesClient object to access its operations. + * + * @return the EnterprisePoliciesClient object. + */ + public EnterprisePoliciesClient getEnterprisePolicies() { + return this.enterprisePolicies; + } + + /** 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 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; + } + + /** 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; + } + + /** + * Initializes an instance of PowerPlatform client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + PowerPlatformImpl( + 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-10-30-preview"; + this.accounts = new AccountsClientImpl(this); + this.enterprisePolicies = new EnterprisePoliciesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PowerPlatformImpl.class); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..0e12f37dec9d --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionImpl.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.powerplatform.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpoint; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnection; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String enterprisePolicyName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName) { + this.resourceGroupName = resourceGroupName; + this.enterprisePolicyName = enterprisePolicyName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, + enterprisePolicyName, + privateEndpointConnectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, + enterprisePolicyName, + privateEndpointConnectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.enterprisePolicyName = Utils.getValueFromIdByName(innerObject.id(), "enterprisePolicies"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..29cd92ccccf9 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1084 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.powerplatform.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerplatform.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 { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final PowerPlatformImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(PowerPlatformImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PowerPlatformPrivateEndpointConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PowerPlatformPrivate") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEnterprisePolicy( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEnterprisePolicySinglePageAsync( + String resourceGroupName, String enterprisePolicyName) { + 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByEnterprisePolicy( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEnterprisePolicySinglePageAsync( + String resourceGroupName, String enterprisePolicyName, 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEnterprisePolicy( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private endpoint connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEnterprisePolicyAsync( + String resourceGroupName, String enterprisePolicyName) { + return new PagedFlux<>(() -> listByEnterprisePolicySinglePageAsync(resourceGroupName, enterprisePolicyName)); + } + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEnterprisePolicyAsync( + String resourceGroupName, String enterprisePolicyName, Context context) { + return new PagedFlux<>( + () -> listByEnterprisePolicySinglePageAsync(resourceGroupName, enterprisePolicyName, context)); + } + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName) { + return new PagedIterable<>(listByEnterprisePolicyAsync(resourceGroupName, enterprisePolicyName)); + } + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context) { + return new PagedIterable<>(listByEnterprisePolicyAsync(resourceGroupName, enterprisePolicyName, context)); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName).block(); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context) + .block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + privateEndpointConnectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters) + .block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Parameters supplied to create or update a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String enterprisePolicyName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enterprisePolicyName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 enterprisePolicyName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionsImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..23a065fe32ac --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnection; +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName) { + PagedIterable inner = + this.serviceClient().listByEnterprisePolicy(resourceGroupName, enterprisePolicyName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context) { + PagedIterable inner = + this.serviceClient().listByEnterprisePolicy(resourceGroupName, enterprisePolicyName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, 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 enterprisePolicyName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, 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 enterprisePolicyName = Utils.getValueFromIdByName(id, "enterprisePolicies"); + if (enterprisePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'enterprisePolicies'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, enterprisePolicyName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourceImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..6f3ac043aacf --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/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.powerplatform.implementation; + +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.powerplatform.PowerPlatformManager 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.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourcesClientImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..c3207e4057f4 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.powerplatform.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final PowerPlatformImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(PowerPlatformImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PowerPlatformPrivateLinkResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PowerPlatformPrivate") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEnterprisePolicy( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform" + + "/enterprisePolicies/{enterprisePolicyName}/privateLinkResources/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("enterprisePolicyName") String enterprisePolicyName, + @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEnterprisePolicySinglePageAsync( + String resourceGroupName, String enterprisePolicyName) { + 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByEnterprisePolicy( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEnterprisePolicySinglePageAsync( + String resourceGroupName, String enterprisePolicyName, 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEnterprisePolicy( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEnterprisePolicyAsync( + String resourceGroupName, String enterprisePolicyName) { + return new PagedFlux<>(() -> listByEnterprisePolicySinglePageAsync(resourceGroupName, enterprisePolicyName)); + } + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEnterprisePolicyAsync( + String resourceGroupName, String enterprisePolicyName, Context context) { + return new PagedFlux<>( + () -> listByEnterprisePolicySinglePageAsync(resourceGroupName, enterprisePolicyName, context)); + } + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName) { + return new PagedIterable<>(listByEnterprisePolicyAsync(resourceGroupName, enterprisePolicyName)); + } + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context) { + return new PagedIterable<>(listByEnterprisePolicyAsync(resourceGroupName, enterprisePolicyName, context)); + } + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, String groupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + groupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String enterprisePolicyName, String groupName, 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 (enterprisePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter enterprisePolicyName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + enterprisePolicyName, + groupName, + accept, + context); + } + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String enterprisePolicyName, String groupName) { + return getWithResponseAsync(resourceGroupName, enterprisePolicyName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String enterprisePolicyName, String groupName) { + return getAsync(resourceGroupName, enterprisePolicyName, groupName).block(); + } + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, enterprisePolicyName, groupName, context).block(); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourcesImpl.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..55180122ce9f --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkResource; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.powerplatform.PowerPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName) { + PagedIterable inner = + this.serviceClient().listByEnterprisePolicy(resourceGroupName, enterprisePolicyName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context) { + PagedIterable inner = + this.serviceClient().listByEnterprisePolicy(resourceGroupName, enterprisePolicyName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String enterprisePolicyName, String groupName) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, enterprisePolicyName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String groupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, enterprisePolicyName, groupName, 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.powerplatform.PowerPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/Utils.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/Utils.java new file mode 100644 index 000000000000..ade57bb9b8b9 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/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.powerplatform.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/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/package-info.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/package-info.java new file mode 100644 index 000000000000..16bbf53a57a9 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for PowerPlatform. null. */ +package com.azure.resourcemanager.powerplatform.implementation; diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Account.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Account.java new file mode 100644 index 000000000000..b36040561d87 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Account.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.fluent.models.AccountInner; +import java.util.Map; + +/** An immutable client-side representation of Account. */ +public interface Account { + /** + * 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: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: The description of the account. + * + * @return the description value. + */ + String description(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.powerplatform.fluent.models.AccountInner object. + * + * @return the inner object. + */ + AccountInner innerModel(); + + /** The entirety of the Account definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Account definition stages. */ + interface DefinitionStages { + /** The first stage of the Account definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Account 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 Account definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Account 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.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + Account create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Account create(Context context); + } + /** The stage of the Account 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 Account definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the account.. + * + * @param description The description of the account. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + /** + * Begins update for the Account resource. + * + * @return the stage of resource update. + */ + Account.Update update(); + + /** The template for Account update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Account apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Account apply(Context context); + } + /** The Account update stages. */ + interface UpdateStages { + /** The stage of the Account 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 Account update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the account.. + * + * @param description The description of the account. + * @return the next definition stage. + */ + Update withDescription(String description); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Account refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Account refresh(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/AccountList.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/AccountList.java new file mode 100644 index 000000000000..e11ea830c140 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/AccountList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerplatform.fluent.models.AccountInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the list accounts operation. */ +@Fluent +public final class AccountList { + /* + * Result of the list accounts operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the list accounts operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the list accounts operation. + * + * @param value the value value to set. + * @return the AccountList object itself. + */ + public AccountList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the AccountList object itself. + */ + public AccountList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Accounts.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Accounts.java new file mode 100644 index 000000000000..466fa813fc8e --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Accounts.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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 Accounts. */ +public interface Accounts { + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 information about an account. + */ + Account getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Get information about an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 information about an account along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @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 accountName); + + /** + * Delete an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve a list of accounts within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve a list of accounts within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Retrieve a list of accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get information about an account. + * + * @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 information about an account along with {@link Response}. + */ + Account getById(String id); + + /** + * Get information about an account. + * + * @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 information about an account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Account resource. + * + * @param name resource name. + * @return the first stage of the new Account definition. + */ + Account.DefinitionStages.Blank define(String name); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/ActionType.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/ActionType.java new file mode 100644 index 000000000000..8cdcc2c10d97 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/ActionType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicies.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicies.java new file mode 100644 index 000000000000..81872cee2e11 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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 EnterprisePolicies. */ +public interface EnterprisePolicies { + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy. + */ + EnterprisePolicy getByResourceGroup(String resourceGroupName, String enterprisePolicyName); + + /** + * Get information about an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName The EnterprisePolicy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about an EnterprisePolicy along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @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 enterprisePolicyName); + + /** + * Delete an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName Name of the EnterprisePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve a list of EnterprisePolicies within a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Retrieve a list of EnterprisePolicies within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list EnterprisePolicy operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get information about an EnterprisePolicy. + * + * @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 information about an EnterprisePolicy along with {@link Response}. + */ + EnterprisePolicy getById(String id); + + /** + * Get information about an EnterprisePolicy. + * + * @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 information about an EnterprisePolicy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an EnterprisePolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an EnterprisePolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EnterprisePolicy resource. + * + * @param name resource name. + * @return the first stage of the new EnterprisePolicy definition. + */ + EnterprisePolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicy.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicy.java new file mode 100644 index 000000000000..0858395a3133 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicy.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.fluent.models.EnterprisePolicyInner; +import java.util.Map; + +/** An immutable client-side representation of EnterprisePolicy. */ +public interface EnterprisePolicy { + /** + * 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 identity property: The identity of the EnterprisePolicy. + * + * @return the identity value. + */ + EnterprisePolicyIdentity identity(); + + /** + * Gets the kind property: The kind (type) of Enterprise Policy. + * + * @return the kind value. + */ + EnterprisePolicyKind kind(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the lockbox property: Settings concerning lockbox. + * + * @return the lockbox value. + */ + PropertiesLockbox lockbox(); + + /** + * Gets the encryption property: The encryption settings for a configuration store. + * + * @return the encryption value. + */ + PropertiesEncryption encryption(); + + /** + * Gets the networkInjection property: Settings concerning network injection. + * + * @return the networkInjection value. + */ + PropertiesNetworkInjection networkInjection(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.powerplatform.fluent.models.EnterprisePolicyInner object. + * + * @return the inner object. + */ + EnterprisePolicyInner innerModel(); + + /** The entirety of the EnterprisePolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + /** The EnterprisePolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the EnterprisePolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the EnterprisePolicy 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 EnterprisePolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithKind withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the EnterprisePolicy definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind (type) of Enterprise Policy.. + * + * @param kind The kind (type) of Enterprise Policy. + * @return the next definition stage. + */ + WithCreate withKind(EnterprisePolicyKind kind); + } + /** + * The stage of the EnterprisePolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithLockbox, + DefinitionStages.WithEncryption, + DefinitionStages.WithNetworkInjection { + /** + * Executes the create request. + * + * @return the created resource. + */ + EnterprisePolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EnterprisePolicy create(Context context); + } + /** The stage of the EnterprisePolicy 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 EnterprisePolicy definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the EnterprisePolicy.. + * + * @param identity The identity of the EnterprisePolicy. + * @return the next definition stage. + */ + WithCreate withIdentity(EnterprisePolicyIdentity identity); + } + /** The stage of the EnterprisePolicy definition allowing to specify lockbox. */ + interface WithLockbox { + /** + * Specifies the lockbox property: Settings concerning lockbox.. + * + * @param lockbox Settings concerning lockbox. + * @return the next definition stage. + */ + WithCreate withLockbox(PropertiesLockbox lockbox); + } + /** The stage of the EnterprisePolicy definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings for a configuration store.. + * + * @param encryption The encryption settings for a configuration store. + * @return the next definition stage. + */ + WithCreate withEncryption(PropertiesEncryption encryption); + } + /** The stage of the EnterprisePolicy definition allowing to specify networkInjection. */ + interface WithNetworkInjection { + /** + * Specifies the networkInjection property: Settings concerning network injection.. + * + * @param networkInjection Settings concerning network injection. + * @return the next definition stage. + */ + WithCreate withNetworkInjection(PropertiesNetworkInjection networkInjection); + } + } + /** + * Begins update for the EnterprisePolicy resource. + * + * @return the stage of resource update. + */ + EnterprisePolicy.Update update(); + + /** The template for EnterprisePolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithKind, + UpdateStages.WithLockbox, + UpdateStages.WithEncryption, + UpdateStages.WithNetworkInjection { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EnterprisePolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EnterprisePolicy apply(Context context); + } + /** The EnterprisePolicy update stages. */ + interface UpdateStages { + /** The stage of the EnterprisePolicy 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 EnterprisePolicy update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the EnterprisePolicy.. + * + * @param identity The identity of the EnterprisePolicy. + * @return the next definition stage. + */ + Update withIdentity(EnterprisePolicyIdentity identity); + } + /** The stage of the EnterprisePolicy update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind (type) of Enterprise Policy.. + * + * @param kind The kind (type) of Enterprise Policy. + * @return the next definition stage. + */ + Update withKind(EnterprisePolicyKind kind); + } + /** The stage of the EnterprisePolicy update allowing to specify lockbox. */ + interface WithLockbox { + /** + * Specifies the lockbox property: Settings concerning lockbox.. + * + * @param lockbox Settings concerning lockbox. + * @return the next definition stage. + */ + Update withLockbox(PropertiesLockbox lockbox); + } + /** The stage of the EnterprisePolicy update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings for a configuration store.. + * + * @param encryption The encryption settings for a configuration store. + * @return the next definition stage. + */ + Update withEncryption(PropertiesEncryption encryption); + } + /** The stage of the EnterprisePolicy update allowing to specify networkInjection. */ + interface WithNetworkInjection { + /** + * Specifies the networkInjection property: Settings concerning network injection.. + * + * @param networkInjection Settings concerning network injection. + * @return the next definition stage. + */ + Update withNetworkInjection(PropertiesNetworkInjection networkInjection); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EnterprisePolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EnterprisePolicy refresh(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyIdentity.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyIdentity.java new file mode 100644 index 000000000000..5538614df004 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyIdentity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The identity of the EnterprisePolicy. */ +@Fluent +public class EnterprisePolicyIdentity { + /* + * The principal id of EnterprisePolicy identity. + */ + @JsonProperty(value = "systemAssignedIdentityPrincipalId", access = JsonProperty.Access.WRITE_ONLY) + private String systemAssignedIdentityPrincipalId; + + /* + * The tenant id associated with the EnterprisePolicy. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the EnterprisePolicy. Currently, the only + * supported type is 'SystemAssigned', which implicitly creates an + * identity. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the systemAssignedIdentityPrincipalId property: The principal id of EnterprisePolicy identity. + * + * @return the systemAssignedIdentityPrincipalId value. + */ + public String systemAssignedIdentityPrincipalId() { + return this.systemAssignedIdentityPrincipalId; + } + + /** + * Get the tenantId property: The tenant id associated with the EnterprisePolicy. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the EnterprisePolicy. Currently, the only supported type is + * 'SystemAssigned', which implicitly creates an identity. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the EnterprisePolicy. Currently, the only supported type is + * 'SystemAssigned', which implicitly creates an identity. + * + * @param type the type value to set. + * @return the EnterprisePolicyIdentity object itself. + */ + public EnterprisePolicyIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyKind.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyKind.java new file mode 100644 index 000000000000..06a5819f4003 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyKind.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnterprisePolicyKind. */ +public final class EnterprisePolicyKind extends ExpandableStringEnum { + /** Static value Lockbox for EnterprisePolicyKind. */ + public static final EnterprisePolicyKind LOCKBOX = fromString("Lockbox"); + + /** Static value PrivateEndpoint for EnterprisePolicyKind. */ + public static final EnterprisePolicyKind PRIVATE_ENDPOINT = fromString("PrivateEndpoint"); + + /** Static value Encryption for EnterprisePolicyKind. */ + public static final EnterprisePolicyKind ENCRYPTION = fromString("Encryption"); + + /** Static value NetworkInjection for EnterprisePolicyKind. */ + public static final EnterprisePolicyKind NETWORK_INJECTION = fromString("NetworkInjection"); + + /** + * Creates or finds a EnterprisePolicyKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnterprisePolicyKind. + */ + @JsonCreator + public static EnterprisePolicyKind fromString(String name) { + return fromString(name, EnterprisePolicyKind.class); + } + + /** + * Gets known EnterprisePolicyKind values. + * + * @return known EnterprisePolicyKind values. + */ + public static Collection values() { + return values(EnterprisePolicyKind.class); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyList.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyList.java new file mode 100644 index 000000000000..8cb10c25cba4 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/EnterprisePolicyList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerplatform.fluent.models.EnterprisePolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the list EnterprisePolicy operation. */ +@Fluent +public final class EnterprisePolicyList { + /* + * Result of the list EnterprisePolicy operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the list EnterprisePolicy operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the list EnterprisePolicy operation. + * + * @param value the value value to set. + * @return the EnterprisePolicyList object itself. + */ + public EnterprisePolicyList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the EnterprisePolicyList object itself. + */ + public EnterprisePolicyList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/KeyProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/KeyProperties.java new file mode 100644 index 000000000000..a8d4bed99309 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/KeyProperties.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.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Url and version of the KeyVault Secret. */ +@Fluent +public final class KeyProperties { + /* + * The identifier of the key vault key used to encrypt data. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The version of the identity which will be used to access key vault. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the name property: The identifier of the key vault key used to encrypt data. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The identifier of the key vault key used to encrypt data. + * + * @param name the name value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: The version of the identity which will be used to access key vault. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the identity which will be used to access key vault. + * + * @param version the version value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/KeyVaultProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/KeyVaultProperties.java new file mode 100644 index 000000000000..0a95406a859e --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/KeyVaultProperties.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings concerning key vault encryption for a configuration store. */ +@Fluent +public final class KeyVaultProperties { + /* + * Uri of KeyVault + */ + @JsonProperty(value = "id") + private String id; + + /* + * Identity of the secret that includes name and version. + */ + @JsonProperty(value = "key") + private KeyProperties key; + + /** + * Get the id property: Uri of KeyVault. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Uri of KeyVault. + * + * @param id the id value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the key property: Identity of the secret that includes name and version. + * + * @return the key value. + */ + public KeyProperties key() { + return this.key; + } + + /** + * Set the key property: Identity of the secret that includes name and version. + * + * @param key the key value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKey(KeyProperties key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (key() != null) { + key().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Operation.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Operation.java new file mode 100644 index 000000000000..9e08ac5d24e3 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/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.powerplatform.models; + +import com.azure.resourcemanager.powerplatform.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.powerplatform.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/OperationDisplay.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/OperationDisplay.java new file mode 100644 index 000000000000..5e4f36200257 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/OperationDisplay.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/OperationListResult.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/OperationListResult.java new file mode 100644 index 000000000000..d27c00f6ef0b --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/OperationListResult.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.powerplatform.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Operations.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Operations.java new file mode 100644 index 000000000000..43432eae3421 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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 PowerPlatform REST API 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available PowerPlatform REST API 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Origin.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Origin.java new file mode 100644 index 000000000000..eb30e0d2eec6 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/Origin.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchAccount.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchAccount.java new file mode 100644 index 000000000000..d987216940b7 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchAccount.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.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.powerplatform.fluent.models.AccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Definition of the account. */ +@Fluent +public final class PatchAccount extends PatchTrackedResource { + /* + * The properties that define configuration for the account. + */ + @JsonProperty(value = "properties") + private AccountProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties that define configuration for the account. + * + * @return the innerProperties value. + */ + private AccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public PatchAccount withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchAccount withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Get the description property: The description of the account. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the account. + * + * @param description the description value to set. + * @return the PatchAccount object itself. + */ + public PatchAccount withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchEnterprisePolicy.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchEnterprisePolicy.java new file mode 100644 index 000000000000..56c85292cfab --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchEnterprisePolicy.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.powerplatform.fluent.models.Properties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Definition of the EnterprisePolicy. */ +@Fluent +public final class PatchEnterprisePolicy extends PatchTrackedResource { + /* + * The identity of the EnterprisePolicy. + */ + @JsonProperty(value = "identity") + private EnterprisePolicyIdentity identity; + + /* + * The kind (type) of Enterprise Policy. + */ + @JsonProperty(value = "kind") + private EnterprisePolicyKind kind; + + /* + * The properties that define configuration for the enterprise policy + */ + @JsonProperty(value = "properties") + private Properties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the identity property: The identity of the EnterprisePolicy. + * + * @return the identity value. + */ + public EnterprisePolicyIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the EnterprisePolicy. + * + * @param identity the identity value to set. + * @return the PatchEnterprisePolicy object itself. + */ + public PatchEnterprisePolicy withIdentity(EnterprisePolicyIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: The kind (type) of Enterprise Policy. + * + * @return the kind value. + */ + public EnterprisePolicyKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind (type) of Enterprise Policy. + * + * @param kind the kind value to set. + * @return the PatchEnterprisePolicy object itself. + */ + public PatchEnterprisePolicy withKind(EnterprisePolicyKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the innerProperties property: The properties that define configuration for the enterprise policy. + * + * @return the innerProperties value. + */ + private Properties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public PatchEnterprisePolicy withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchEnterprisePolicy withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Get the lockbox property: Settings concerning lockbox. + * + * @return the lockbox value. + */ + public PropertiesLockbox lockbox() { + return this.innerProperties() == null ? null : this.innerProperties().lockbox(); + } + + /** + * Set the lockbox property: Settings concerning lockbox. + * + * @param lockbox the lockbox value to set. + * @return the PatchEnterprisePolicy object itself. + */ + public PatchEnterprisePolicy withLockbox(PropertiesLockbox lockbox) { + if (this.innerProperties() == null) { + this.innerProperties = new Properties(); + } + this.innerProperties().withLockbox(lockbox); + return this; + } + + /** + * Get the encryption property: The encryption settings for a configuration store. + * + * @return the encryption value. + */ + public PropertiesEncryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption settings for a configuration store. + * + * @param encryption the encryption value to set. + * @return the PatchEnterprisePolicy object itself. + */ + public PatchEnterprisePolicy withEncryption(PropertiesEncryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new Properties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkInjection property: Settings concerning network injection. + * + * @return the networkInjection value. + */ + public PropertiesNetworkInjection networkInjection() { + return this.innerProperties() == null ? null : this.innerProperties().networkInjection(); + } + + /** + * Set the networkInjection property: Settings concerning network injection. + * + * @param networkInjection the networkInjection value to set. + * @return the PatchEnterprisePolicy object itself. + */ + public PatchEnterprisePolicy withNetworkInjection(PropertiesNetworkInjection networkInjection) { + if (this.innerProperties() == null) { + this.innerProperties = new Properties(); + } + this.innerProperties().withNetworkInjection(networkInjection); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchTrackedResource.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchTrackedResource.java new file mode 100644 index 000000000000..562588a6e9c0 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PatchTrackedResource.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.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a + * 'location'. + */ +@Fluent +public class PatchTrackedResource extends ProxyResource { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PatchTrackedResource object itself. + */ + public PatchTrackedResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the PatchTrackedResource object itself. + */ + public PatchTrackedResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpoint.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpoint.java new file mode 100644 index 000000000000..ae93f1f3d244 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpoint.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.powerplatform.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnection.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..063751bb07ea --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnection.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.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: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.powerplatform.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, enterprisePolicyName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @return the next definition stage. + */ + WithCreate withExistingEnterprisePolicy(String resourceGroupName, String enterprisePolicyName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnectionListResult.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..d6f9d3509675 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnectionProvisioningState.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..007795aee0aa --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnections.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..398e688b1547 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointConnections.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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 { + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @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 private endpoint connections as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName); + + /** + * List all private endpoint connections on an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection get( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 enterprisePolicyName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 enterprisePolicyName, String privateEndpointConnectionName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + 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/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointServiceConnectionStatus.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..1fd52f10e580 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResource.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResource.java new file mode 100644 index 000000000000..d327db2185a1 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/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.powerplatform.models; + +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the 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.powerplatform.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResourceListResult.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..da06f83cf802 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResourceListResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerplatform.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResult { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResources.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResources.java new file mode 100644 index 000000000000..285e5dadb316 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkResources.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.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 { + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByEnterprisePolicy(String resourceGroupName, String enterprisePolicyName); + + /** + * Gets the private link resources that need to be created for enterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for enterprisePolicy as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByEnterprisePolicy( + String resourceGroupName, String enterprisePolicyName, Context context); + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy. + */ + PrivateLinkResource get(String resourceGroupName, String enterprisePolicyName, String groupName); + + /** + * Gets the private link resources that need to be created for an EnterprisePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enterprisePolicyName EnterprisePolicy for the Microsoft Azure subscription. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for an EnterprisePolicy along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String enterprisePolicyName, String groupName, Context context); +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkServiceConnectionState.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..85e73362c753 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesEncryption.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesEncryption.java new file mode 100644 index 000000000000..3ab381763f2c --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesEncryption.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The encryption settings for a configuration store. */ +@Fluent +public final class PropertiesEncryption { + /* + * Key vault properties. + */ + @JsonProperty(value = "keyVault") + private KeyVaultProperties keyVault; + + /* + * The state of onboarding, which only appears in the response. + */ + @JsonProperty(value = "state") + private State state; + + /** + * Get the keyVault property: Key vault properties. + * + * @return the keyVault value. + */ + public KeyVaultProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: Key vault properties. + * + * @param keyVault the keyVault value to set. + * @return the PropertiesEncryption object itself. + */ + public PropertiesEncryption withKeyVault(KeyVaultProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** + * Get the state property: The state of onboarding, which only appears in the response. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: The state of onboarding, which only appears in the response. + * + * @param state the state value to set. + * @return the PropertiesEncryption object itself. + */ + public PropertiesEncryption withState(State state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesLockbox.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesLockbox.java new file mode 100644 index 000000000000..5a019a50841c --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesLockbox.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.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings concerning lockbox. */ +@Fluent +public final class PropertiesLockbox { + /* + * lockbox configuration + */ + @JsonProperty(value = "state") + private State state; + + /** + * Get the state property: lockbox configuration. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: lockbox configuration. + * + * @param state the state value to set. + * @return the PropertiesLockbox object itself. + */ + public PropertiesLockbox withState(State state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesNetworkInjection.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesNetworkInjection.java new file mode 100644 index 000000000000..f7c5a1aa9200 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/PropertiesNetworkInjection.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings concerning network injection. */ +@Fluent +public final class PropertiesNetworkInjection { + /* + * Network injection configuration + */ + @JsonProperty(value = "virtualNetworks") + private VirtualNetworkPropertiesList virtualNetworks; + + /** + * Get the virtualNetworks property: Network injection configuration. + * + * @return the virtualNetworks value. + */ + public VirtualNetworkPropertiesList virtualNetworks() { + return this.virtualNetworks; + } + + /** + * Set the virtualNetworks property: Network injection configuration. + * + * @param virtualNetworks the virtualNetworks value to set. + * @return the PropertiesNetworkInjection object itself. + */ + public PropertiesNetworkInjection withVirtualNetworks(VirtualNetworkPropertiesList virtualNetworks) { + this.virtualNetworks = virtualNetworks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworks() != null) { + virtualNetworks().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/ResourceIdentityType.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/ResourceIdentityType.java new file mode 100644 index 000000000000..4af67c956f80 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/ResourceIdentityType.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.powerplatform.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/State.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/State.java new file mode 100644 index 000000000000..d0cac0db78d3 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/State.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for State. */ +public final class State extends ExpandableStringEnum { + /** Static value Enabled for State. */ + public static final State ENABLED = fromString("Enabled"); + + /** Static value Disabled for State. */ + public static final State DISABLED = fromString("Disabled"); + + /** Static value NotConfigured for State. */ + public static final State NOT_CONFIGURED = fromString("NotConfigured"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/SubnetProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/SubnetProperties.java new file mode 100644 index 000000000000..7fc3ba730269 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/SubnetProperties.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.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a subnet. */ +@Fluent +public final class SubnetProperties { + /* + * Subnet name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Subnet name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Subnet name. + * + * @param name the name value to set. + * @return the SubnetProperties object itself. + */ + public SubnetProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/VirtualNetworkProperties.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/VirtualNetworkProperties.java new file mode 100644 index 000000000000..656f3a8c91fe --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/VirtualNetworkProperties.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings concerning the virtual network. */ +@Fluent +public final class VirtualNetworkProperties { + /* + * Uri of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Properties of a subnet. + */ + @JsonProperty(value = "subnet") + private SubnetProperties subnet; + + /** + * Get the id property: Uri of the virtual network. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Uri of the virtual network. + * + * @param id the id value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the subnet property: Properties of a subnet. + * + * @return the subnet value. + */ + public SubnetProperties subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Properties of a subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withSubnet(SubnetProperties subnet) { + this.subnet = subnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/VirtualNetworkPropertiesList.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/VirtualNetworkPropertiesList.java new file mode 100644 index 000000000000..8da14301ff18 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/VirtualNetworkPropertiesList.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class VirtualNetworkPropertiesList { + /* + * Array of virtual networks. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Array of virtual networks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of virtual networks. + * + * @param value the value value to set. + * @return the VirtualNetworkPropertiesList object itself. + */ + public VirtualNetworkPropertiesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkPropertiesList object itself. + */ + public VirtualNetworkPropertiesList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/package-info.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/package-info.java new file mode 100644 index 000000000000..9a40626086b7 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for PowerPlatform. null. */ +package com.azure.resourcemanager.powerplatform.models; diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/package-info.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/package-info.java new file mode 100644 index 000000000000..18b7680fd436 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/com/azure/resourcemanager/powerplatform/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for PowerPlatform. null. */ +package com.azure.resourcemanager.powerplatform; diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/module-info.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/main/java/module-info.java new file mode 100644 index 000000000000..9e67beb9b7c4 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/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.powerplatform { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.powerplatform; + exports com.azure.resourcemanager.powerplatform.fluent; + exports com.azure.resourcemanager.powerplatform.fluent.models; + exports com.azure.resourcemanager.powerplatform.models; + + opens com.azure.resourcemanager.powerplatform.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.powerplatform.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsCreateOrUpdateSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..73af9fc44259 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsCreateOrUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts CreateOrUpdate. */ +public final class AccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/createOrUpdateAccount.json + */ + /** + * Sample code: Create or update account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void createOrUpdateAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .accounts() + .define("account") + .withRegion("East US") + .withExistingResourceGroup("resourceGroup") + .withTags(mapOf("Organization", "Administration")) + .withDescription("Description of the account.") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsDeleteSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsDeleteSamples.java new file mode 100644 index 000000000000..3fb1c3553e53 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts Delete. */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/deleteAccount.json + */ + /** + * Sample code: Delete account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void deleteAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().deleteWithResponse("resourceGroup", "account", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsGetByResourceGroupSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..faa01b83c053 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts GetByResourceGroup. */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/getAccount.json + */ + /** + * Sample code: Get account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().getByResourceGroupWithResponse("rg", "account", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsListByResourceGroupSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsListByResourceGroupSamples.java new file mode 100644 index 000000000000..aaadf975d40b --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts ListByResourceGroup. */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listAccountsByResourceGroup.json + */ + /** + * Sample code: List accounts by resource group. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listAccountsByResourceGroup( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().listByResourceGroup("rg", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsListSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsListSamples.java new file mode 100644 index 000000000000..b2d8f419254a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for Accounts List. */ +public final class AccountsListSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listAccountsBySubscription.json + */ + /** + * Sample code: List accounts by subscription. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listAccountsBySubscription( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.accounts().list(Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsUpdateSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsUpdateSamples.java new file mode 100644 index 000000000000..87fe1419dd2a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/AccountsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.models.Account; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Update. */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/updateAccount.json + */ + /** + * Sample code: Update account. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void updateAccount(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + Account resource = + manager.accounts().getByResourceGroupWithResponse("resourceGroup", "account", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("Organization", "Administration")) + .withDescription("Description of account.") + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesCreateOrUpdateSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f56dde81e331 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesCreateOrUpdateSamples.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.powerplatform.generated; + +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyIdentity; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyKind; +import com.azure.resourcemanager.powerplatform.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for EnterprisePolicies CreateOrUpdate. */ +public final class EnterprisePoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/createOrUpdateEnterprisePolicy.json + */ + /** + * Sample code: Create or update EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void createOrUpdateEnterprisePolicy( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .enterprisePolicies() + .define("enterprisePolicy") + .withRegion("East US") + .withExistingResourceGroup("resourceGroup") + .withKind(EnterprisePolicyKind.LOCKBOX) + .withTags(mapOf("Organization", "Administration")) + .withIdentity(new EnterprisePolicyIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesDeleteSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesDeleteSamples.java new file mode 100644 index 000000000000..d505c45a91c6 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies Delete. */ +public final class EnterprisePoliciesDeleteSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/deleteEnterprisePolicy.json + */ + /** + * Sample code: Delete an EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void deleteAnEnterprisePolicy(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().deleteWithResponse("resourceGroup", "enterprisePolicy", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesGetByResourceGroupSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..07d6fd5d425f --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies GetByResourceGroup. */ +public final class EnterprisePoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/getEnterprisePolicy.json + */ + /** + * Sample code: Get an EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getAnEnterprisePolicy(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().getByResourceGroupWithResponse("rg", "enterprisePolicy", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesListByResourceGroupSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..591af5f1ec89 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies ListByResourceGroup. */ +public final class EnterprisePoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listEnterprisePoliciesByResourceGroup.json + */ + /** + * Sample code: List EnterprisePolicies by resource group. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listEnterprisePoliciesByResourceGroup( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesListSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesListSamples.java new file mode 100644 index 000000000000..7dcde0ccc27a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for EnterprisePolicies List. */ +public final class EnterprisePoliciesListSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listEnterprisePoliciesBySubscription.json + */ + /** + * Sample code: List EnterprisePolicies by subscription. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listEnterprisePoliciesBySubscription( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.enterprisePolicies().list(Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesUpdateSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesUpdateSamples.java new file mode 100644 index 000000000000..2bb8b52d3176 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/EnterprisePoliciesUpdateSamples.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.powerplatform.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicy; +import com.azure.resourcemanager.powerplatform.models.EnterprisePolicyIdentity; +import com.azure.resourcemanager.powerplatform.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for EnterprisePolicies Update. */ +public final class EnterprisePoliciesUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/updateEnterprisePolicy.json + */ + /** + * Sample code: Update EnterprisePolicy. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void updateEnterprisePolicy(com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + EnterprisePolicy resource = + manager + .enterprisePolicies() + .getByResourceGroupWithResponse("resourceGroup", "enterprisePolicy", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("Organization", "Administration")) + .withIdentity(new EnterprisePolicyIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/OperationsListSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/OperationsListSamples.java new file mode 100644 index 000000000000..3fb3461ca651 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/listOperations.json + */ + /** + * Sample code: Lists all of the available PowerPlatform REST API operations. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void listsAllOfTheAvailablePowerPlatformRESTAPIOperations( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..32575d81b5dd --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.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.powerplatform.generated; + +import com.azure.resourcemanager.powerplatform.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.powerplatform.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .privateEndpointConnections() + .define("privateEndpointConnectionName") + .withExistingEnterprisePolicy("rg1", "ddb1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")) + .create(); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..2437d66c6c7a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateEndpointConnections().delete("rg1", "ddb1", "privateEndpointConnectionName", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..becad97a7ef3 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("rg1", "ddb1", "privateEndpointConnectionName", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsListByEnterprisePolicySamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsListByEnterprisePolicySamples.java new file mode 100644 index 000000000000..e339cbab4fbc --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateEndpointConnectionsListByEnterprisePolicySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByEnterprisePolicy. */ +public final class PrivateEndpointConnectionsListByEnterprisePolicySamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateEndpointConnectionListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateEndpointConnections().listByEnterprisePolicy("rg1", "ddb1", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateLinkResourcesGetSamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..4763190199b5 --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateLinkResourceGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateLinkResources().getWithResponse("rg1", "ddb1", "sql", Context.NONE); + } +} diff --git a/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateLinkResourcesListByEnterprisePolicySamples.java b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateLinkResourcesListByEnterprisePolicySamples.java new file mode 100644 index 000000000000..efd4fb99b73a --- /dev/null +++ b/sdk/powerplatform/azure-resourcemanager-powerplatform/src/samples/java/com/azure/resourcemanager/powerplatform/generated/PrivateLinkResourcesListByEnterprisePolicySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerplatform.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByEnterprisePolicy. */ +public final class PrivateLinkResourcesListByEnterprisePolicySamples { + /* + * x-ms-original-file: specification/powerplatform/resource-manager/Microsoft.PowerPlatform/preview/2020-10-30-preview/examples/PrivateLinkResourceListGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PowerPlatformManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.powerplatform.PowerPlatformManager manager) { + manager.privateLinkResources().listByEnterprisePolicy("rg1", "ddb1", Context.NONE); + } +} diff --git a/sdk/powerplatform/ci.yml b/sdk/powerplatform/ci.yml new file mode 100644 index 000000000000..1f3c6d09aad7 --- /dev/null +++ b/sdk/powerplatform/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/powerplatform/ci.yml + - sdk/powerplatform/azure-resourcemanager-powerplatform/ + exclude: + - sdk/powerplatform/pom.xml + - sdk/powerplatform/azure-resourcemanager-powerplatform/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerplatform/ci.yml + - sdk/powerplatform/azure-resourcemanager-powerplatform/ + exclude: + - sdk/powerplatform/pom.xml + - sdk/powerplatform/azure-resourcemanager-powerplatform/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: powerplatform + Artifacts: + - name: azure-resourcemanager-powerplatform + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerpowerplatform diff --git a/sdk/powerplatform/pom.xml b/sdk/powerplatform/pom.xml new file mode 100644 index 000000000000..67d44878ae23 --- /dev/null +++ b/sdk/powerplatform/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-powerplatform-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-powerplatform + + + +