diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 369042f3051b..912d55f03649 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -373,6 +373,7 @@ com.azure.resourcemanager:azure-resourcemanager-connectedvmware;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-alertsmanagement;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-nginx;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-agrifood;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-solutions;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 0dceda86fc1c..6fce02d57172 100644 --- a/pom.xml +++ b/pom.xml @@ -149,6 +149,7 @@ sdk/servicefabric sdk/servicelinker sdk/signalr + sdk/solutions sdk/spring sdk/spring-experimental sdk/sqlvirtualmachine diff --git a/sdk/solutions/azure-resourcemanager-solutions/CHANGELOG.md b/sdk/solutions/azure-resourcemanager-solutions/CHANGELOG.md new file mode 100644 index 000000000000..7fb561459133 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-09-09) + +- Azure Resource Manager ManagedApplication client library for Java. This package contains Microsoft Azure SDK for ManagedApplication Management SDK. Managed Application Client. Package tag package-managedapplications-2021-07. 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/solutions/azure-resourcemanager-solutions/README.md b/sdk/solutions/azure-resourcemanager-solutions/README.md new file mode 100644 index 000000000000..dbb8e37cbcf9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ManagedApplication client library for Java + +Azure Resource Manager ManagedApplication client library for Java. + +This package contains Microsoft Azure SDK for ManagedApplication Management SDK. Managed Application Client. Package tag package-managedapplications-2021-07. 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-solutions;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-solutions + 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(); +ManagedApplicationManager manager = ManagedApplicationManager + .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/solutions/azure-resourcemanager-solutions/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/solutions/azure-resourcemanager-solutions/SAMPLE.md b/sdk/solutions/azure-resourcemanager-solutions/SAMPLE.md new file mode 100644 index 000000000000..aaf64241169d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/SAMPLE.md @@ -0,0 +1,910 @@ +# Code snippets and samples + + +## ApplicationDefinitions + +- [CreateOrUpdate](#applicationdefinitions_createorupdate) +- [CreateOrUpdateById](#applicationdefinitions_createorupdatebyid) +- [Delete](#applicationdefinitions_delete) +- [DeleteById](#applicationdefinitions_deletebyid) +- [GetById](#applicationdefinitions_getbyid) +- [GetByResourceGroup](#applicationdefinitions_getbyresourcegroup) +- [List](#applicationdefinitions_list) +- [ListByResourceGroup](#applicationdefinitions_listbyresourcegroup) +- [Update](#applicationdefinitions_update) +- [UpdateById](#applicationdefinitions_updatebyid) + +## Applications + +- [CreateOrUpdate](#applications_createorupdate) +- [CreateOrUpdateById](#applications_createorupdatebyid) +- [Delete](#applications_delete) +- [DeleteById](#applications_deletebyid) +- [GetById](#applications_getbyid) +- [GetByResourceGroup](#applications_getbyresourcegroup) +- [List](#applications_list) +- [ListAllowedUpgradePlans](#applications_listallowedupgradeplans) +- [ListByResourceGroup](#applications_listbyresourcegroup) +- [ListTokens](#applications_listtokens) +- [RefreshPermissions](#applications_refreshpermissions) +- [Update](#applications_update) +- [UpdateAccess](#applications_updateaccess) +- [UpdateById](#applications_updatebyid) + +## JitRequests + +- [CreateOrUpdate](#jitrequests_createorupdate) +- [Delete](#jitrequests_delete) +- [GetByResourceGroup](#jitrequests_getbyresourcegroup) +- [ListByResourceGroup](#jitrequests_listbyresourcegroup) +- [ListBySubscription](#jitrequests_listbysubscription) +- [Update](#jitrequests_update) + +## ResourceProvider + +- [ListOperations](#resourceprovider_listoperations) +### ApplicationDefinitions_CreateOrUpdate + +```java +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import java.util.Arrays; + +/** Samples for ApplicationDefinitions CreateOrUpdate. */ +public final class ApplicationDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplicationDefinition.json + */ + /** + * Sample code: Create or update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applicationDefinitions() + .define("myManagedApplicationDef") + .withRegion((String) null) + .withExistingResourceGroup("rg") + .withLockLevel(ApplicationLockLevel.NONE) + .withDisplayName("myManagedApplicationDef") + .withAuthorizations( + Arrays + .asList( + new ApplicationAuthorization() + .withPrincipalId("validprincipalguid") + .withRoleDefinitionId("validroleguid"))) + .withDescription("myManagedApplicationDef description") + .withPackageFileUri("https://path/to/packagezipfile") + .create(); + } +} +``` + +### ApplicationDefinitions_CreateOrUpdateById + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import java.util.Arrays; + +/** Samples for ApplicationDefinitions CreateOrUpdateById. */ +public final class ApplicationDefinitionsCreateOrUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplicationDefinition.json + */ + /** + * Sample code: Create or update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applicationDefinitions() + .createOrUpdateByIdWithResponse( + "rg", + "myManagedApplicationDef", + new ApplicationDefinitionInner() + .withLockLevel(ApplicationLockLevel.NONE) + .withDisplayName("myManagedApplicationDef") + .withAuthorizations( + Arrays + .asList( + new ApplicationAuthorization() + .withPrincipalId("validprincipalguid") + .withRoleDefinitionId("validroleguid"))) + .withDescription("myManagedApplicationDef description") + .withPackageFileUri("https://path/to/packagezipfile"), + Context.NONE); + } +} +``` + +### ApplicationDefinitions_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions Delete. */ +public final class ApplicationDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplicationDefinition.json + */ + /** + * Sample code: delete managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deleteManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().deleteWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} +``` + +### ApplicationDefinitions_DeleteById + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions DeleteById. */ +public final class ApplicationDefinitionsDeleteByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplicationDefinition.json + */ + /** + * Sample code: Deletes managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deletesManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().deleteByIdWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} +``` + +### ApplicationDefinitions_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions GetById. */ +public final class ApplicationDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplicationDefinition.json + */ + /** + * Sample code: Get managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().getByIdWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} +``` + +### ApplicationDefinitions_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions GetByResourceGroup. */ +public final class ApplicationDefinitionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplicationDefinition.json + */ + /** + * Sample code: Get managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().getByResourceGroupWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} +``` + +### ApplicationDefinitions_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions List. */ +public final class ApplicationDefinitionsListSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationDefinitionsBySubscription.json + */ + /** + * Sample code: Lists all the application definitions within a subscription. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllTheApplicationDefinitionsWithinASubscription( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().list(Context.NONE); + } +} +``` + +### ApplicationDefinitions_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions ListByResourceGroup. */ +public final class ApplicationDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationDefinitionsByResourceGroup.json + */ + /** + * Sample code: Lists the managed application definitions in a resource group. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsTheManagedApplicationDefinitionsInAResourceGroup( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().listByResourceGroup("rg", Context.NONE); + } +} +``` + +### ApplicationDefinitions_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ApplicationDefinition; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ApplicationDefinitions Update. */ +public final class ApplicationDefinitionsUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplicationDefinition.json + */ + /** + * Sample code: Update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + ApplicationDefinition resource = + manager + .applicationDefinitions() + .getByResourceGroupWithResponse("rg", "myManagedApplicationDef", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Finance")).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; + } +} +``` + +### ApplicationDefinitions_UpdateById + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionPatchable; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ApplicationDefinitions UpdateById. */ +public final class ApplicationDefinitionsUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplicationDefinition.json + */ + /** + * Sample code: Update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applicationDefinitions() + .updateByIdWithResponse( + "rg", + "myManagedApplicationDef", + new ApplicationDefinitionPatchable().withTags(mapOf("department", "Finance")), + Context.NONE); + } + + @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; + } +} +``` + +### Applications_CreateOrUpdate + +```java +/** Samples for Applications CreateOrUpdate. */ +public final class ApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplication.json + */ + /** + * Sample code: Create or update managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .define("myManagedApplication") + .withRegion((String) null) + .withExistingResourceGroup("rg") + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef") + .create(); + } +} +``` + +### Applications_CreateOrUpdateById + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; + +/** Samples for Applications CreateOrUpdateById. */ +public final class ApplicationsCreateOrUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplicationById.json + */ + /** + * Sample code: Creates or updates a managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createsOrUpdatesAManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .createOrUpdateById( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + new ApplicationInner() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + Context.NONE); + } +} +``` + +### Applications_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Applications Delete. */ +public final class ApplicationsDeleteSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplication.json + */ + /** + * Sample code: Delete managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deleteManagedApplication(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().delete("rg", "myManagedApplication", Context.NONE); + } +} +``` + +### Applications_DeleteById + +```java +import com.azure.core.util.Context; + +/** Samples for Applications DeleteById. */ +public final class ApplicationsDeleteByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplicationById.json + */ + /** + * Sample code: Deletes the managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deletesTheManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .deleteById( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + Context.NONE); + } +} +``` + +### Applications_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for Applications GetById. */ +public final class ApplicationsGetByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplicationById.json + */ + /** + * Sample code: Gets the managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getsTheManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .getByIdWithResponse( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + Context.NONE); + } +} +``` + +### Applications_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Applications GetByResourceGroup. */ +public final class ApplicationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplication.json + */ + /** + * Sample code: Get a managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getAManagedApplication(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().getByResourceGroupWithResponse("rg", "myManagedApplication", Context.NONE); + } +} +``` + +### Applications_List + +```java +import com.azure.core.util.Context; + +/** Samples for Applications List. */ +public final class ApplicationsListSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationsByResourceGroup.json + */ + /** + * Sample code: Lists all the applications within a subscription. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllTheApplicationsWithinASubscription( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().list(Context.NONE); + } +} +``` + +### Applications_ListAllowedUpgradePlans + +```java +import com.azure.core.util.Context; + +/** Samples for Applications ListAllowedUpgradePlans. */ +public final class ApplicationsListAllowedUpgradePlansSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listAllowedUpgradePlans.json + */ + /** + * Sample code: List allowed upgrade plans for application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listAllowedUpgradePlansForApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().listAllowedUpgradePlansWithResponse("rg", "myManagedApplication", Context.NONE); + } +} +``` + +### Applications_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Applications ListByResourceGroup. */ +public final class ApplicationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationsByResourceGroup.json + */ + /** + * Sample code: Lists all the applications within a resource group. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllTheApplicationsWithinAResourceGroup( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().listByResourceGroup("rg", Context.NONE); + } +} +``` + +### Applications_ListTokens + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ListTokenRequest; +import java.util.Arrays; + +/** Samples for Applications ListTokens. */ +public final class ApplicationsListTokensSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listToken.json + */ + /** + * Sample code: List tokens for application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listTokensForApplication(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .listTokensWithResponse( + "rg", + "myManagedApplication", + new ListTokenRequest() + .withAuthorizationAudience("authorizationAudience") + .withUserAssignedIdentities(Arrays.asList("IdentityOne", "IdentityTwo")), + Context.NONE); + } +} +``` + +### Applications_RefreshPermissions + +```java +import com.azure.core.util.Context; + +/** Samples for Applications RefreshPermissions. */ +public final class ApplicationsRefreshPermissionsSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/refreshApplicationPermissions.json + */ + /** + * Sample code: Refresh managed application permissions. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void refreshManagedApplicationPermissions( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().refreshPermissions("rg", "myManagedApplication", Context.NONE); + } +} +``` + +### Applications_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.Application; + +/** Samples for Applications Update. */ +public final class ApplicationsUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplication.json + */ + /** + * Sample code: Updates managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updatesManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + Application resource = + manager + .applications() + .getByResourceGroupWithResponse("rg", "myManagedApplication", Context.NONE) + .getValue(); + resource + .update() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef") + .apply(); + } +} +``` + +### Applications_UpdateAccess + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.JitRequestMetadata; +import com.azure.resourcemanager.solutions.models.Status; +import com.azure.resourcemanager.solutions.models.Substatus; + +/** Samples for Applications UpdateAccess. */ +public final class ApplicationsUpdateAccessSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateAccess.json + */ + /** + * Sample code: Update access for application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateAccessForApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .updateAccess( + "rg", + "myManagedApplication", + new UpdateAccessDefinitionInner() + .withApprover("amauser") + .withMetadata( + new JitRequestMetadata() + .withOriginRequestId("originRequestId") + .withRequestorId("RequestorId") + .withTenantDisplayName("TenantDisplayName") + .withSubjectDisplayName("SubjectDisplayName")) + .withStatus(Status.ELEVATE) + .withSubStatus(Substatus.APPROVED), + Context.NONE); + } +} +``` + +### Applications_UpdateById + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ApplicationPatchable; + +/** Samples for Applications UpdateById. */ +public final class ApplicationsUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplicationById.json + */ + /** + * Sample code: Updates an existing managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updatesAnExistingManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .updateById( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + new ApplicationPatchable() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + Context.NONE); + } +} +``` + +### JitRequests_CreateOrUpdate + +```java +import com.azure.resourcemanager.solutions.models.JitAuthorizationPolicies; +import com.azure.resourcemanager.solutions.models.JitSchedulingPolicy; +import com.azure.resourcemanager.solutions.models.JitSchedulingType; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for JitRequests CreateOrUpdate. */ +public final class JitRequestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateJitRequest.json + */ + /** + * Sample code: Create or update jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .jitRequests() + .define("myJitRequest") + .withRegion((String) null) + .withExistingResourceGroup("rg") + .withApplicationResourceId( + "/subscriptions/00c76877-e316-48a7-af60-4a09fec9d43f/resourceGroups/52F30DB2/providers/Microsoft.Solutions/applications/7E193158") + .withJitAuthorizationPolicies( + Arrays + .asList( + new JitAuthorizationPolicies() + .withPrincipalId("1db8e132e2934dbcb8e1178a61319491") + .withRoleDefinitionId("ecd05a23-931a-4c38-a52b-ac7c4c583334"))) + .withJitSchedulingPolicy( + new JitSchedulingPolicy() + .withType(JitSchedulingType.ONCE) + .withDuration(Duration.parse("PT8H")) + .withStartTime(OffsetDateTime.parse("2021-04-22T05:48:30.6661804Z"))) + .create(); + } +} +``` + +### JitRequests_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for JitRequests Delete. */ +public final class JitRequestsDeleteSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteJitRequest.json + */ + /** + * Sample code: Delete jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deleteJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().deleteWithResponse("rg", "myJitRequest", Context.NONE); + } +} +``` + +### JitRequests_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for JitRequests GetByResourceGroup. */ +public final class JitRequestsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getJitRequest.json + */ + /** + * Sample code: Gets the jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getsTheJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().getByResourceGroupWithResponse("rg", "myJitRequest", Context.NONE); + } +} +``` + +### JitRequests_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for JitRequests ListByResourceGroup. */ +public final class JitRequestsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listJitRequestsByResourceGroup.json + */ + /** + * Sample code: Lists all JIT requests within the resource group. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllJITRequestsWithinTheResourceGroup( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().listByResourceGroupWithResponse("rg", Context.NONE); + } +} +``` + +### JitRequests_ListBySubscription + +```java +import com.azure.core.util.Context; + +/** Samples for JitRequests ListBySubscription. */ +public final class JitRequestsListBySubscriptionSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listJitRequestsByResourceGroup.json + */ + /** + * Sample code: Lists all JIT requests within the subscription. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllJITRequestsWithinTheSubscription( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().listBySubscriptionWithResponse(Context.NONE); + } +} +``` + +### JitRequests_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.JitRequestDefinition; +import java.util.HashMap; +import java.util.Map; + +/** Samples for JitRequests Update. */ +public final class JitRequestsUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateJitRequest.json + */ + /** + * Sample code: Update jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + JitRequestDefinition resource = + manager.jitRequests().getByResourceGroupWithResponse("rg", "myJitRequest", Context.NONE).getValue(); + resource.update().withTags(mapOf("department", "Finance")).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; + } +} +``` + +### ResourceProvider_ListOperations + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider ListOperations. */ +public final class ResourceProviderListOperationsSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listSolutionsOperations.json + */ + /** + * Sample code: List Solutions operations. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listSolutionsOperations(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.resourceProviders().listOperations(Context.NONE); + } +} +``` + diff --git a/sdk/solutions/azure-resourcemanager-solutions/pom.xml b/sdk/solutions/azure-resourcemanager-solutions/pom.xml new file mode 100644 index 000000000000..f0c6b4ab73e5 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/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-solutions + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ManagedApplication Management + This package contains Microsoft Azure SDK for ManagedApplication Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Managed Application Client. Package tag package-managedapplications-2021-07. + 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.32.0 + + + com.azure + azure-core-management + 1.8.0 + + + diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/ManagedApplicationManager.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/ManagedApplicationManager.java new file mode 100644 index 000000000000..32d233c70276 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/ManagedApplicationManager.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions; + +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.solutions.fluent.ManagedApplicationManagementClient; +import com.azure.resourcemanager.solutions.implementation.ApplicationDefinitionsImpl; +import com.azure.resourcemanager.solutions.implementation.ApplicationsImpl; +import com.azure.resourcemanager.solutions.implementation.JitRequestsImpl; +import com.azure.resourcemanager.solutions.implementation.ManagedApplicationManagementClientBuilder; +import com.azure.resourcemanager.solutions.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitions; +import com.azure.resourcemanager.solutions.models.Applications; +import com.azure.resourcemanager.solutions.models.JitRequests; +import com.azure.resourcemanager.solutions.models.ResourceProviders; +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 ManagedApplicationManager. Managed Application Client. */ +public final class ManagedApplicationManager { + private ResourceProviders resourceProviders; + + private Applications applications; + + private ApplicationDefinitions applicationDefinitions; + + private JitRequests jitRequests; + + private final ManagedApplicationManagementClient clientObject; + + private ManagedApplicationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ManagedApplicationManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ManagedApplication service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ManagedApplication service API instance. + */ + public static ManagedApplicationManager 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 ManagedApplication service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ManagedApplication service API instance. + */ + public static ManagedApplicationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ManagedApplicationManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ManagedApplicationManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ManagedApplicationManager.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 ManagedApplication service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ManagedApplication service API instance. + */ + public ManagedApplicationManager 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.solutions") + .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 ManagedApplicationManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of Applications. It manages Application. + * + * @return Resource collection API of Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(clientObject.getApplications(), this); + } + return applications; + } + + /** + * Gets the resource collection API of ApplicationDefinitions. It manages ApplicationDefinition. + * + * @return Resource collection API of ApplicationDefinitions. + */ + public ApplicationDefinitions applicationDefinitions() { + if (this.applicationDefinitions == null) { + this.applicationDefinitions = + new ApplicationDefinitionsImpl(clientObject.getApplicationDefinitions(), this); + } + return applicationDefinitions; + } + + /** + * Gets the resource collection API of JitRequests. It manages JitRequestDefinition. + * + * @return Resource collection API of JitRequests. + */ + public JitRequests jitRequests() { + if (this.jitRequests == null) { + this.jitRequests = new JitRequestsImpl(clientObject.getJitRequests(), this); + } + return jitRequests; + } + + /** + * @return Wrapped service client ManagedApplicationManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ManagedApplicationManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationDefinitionsClient.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationDefinitionsClient.java new file mode 100644 index 000000000000..de1aded54d0a --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationDefinitionsClient.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.models.ApplicationDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionPatchable; + +/** An instance of this class provides access to all the operations defined in ApplicationDefinitionsClient. */ +public interface ApplicationDefinitionsClient { + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationDefinitionInner getByResourceGroup(String resourceGroupName, String applicationDefinitionName); + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 applicationDefinitionName); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 applicationDefinitionName, Context context); + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationDefinitionInner createOrUpdate( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters); + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + Context context); + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationDefinitionInner update( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters); + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable parameters, + Context context); + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationDefinitionInner getById(String resourceGroupName, String applicationDefinitionName); + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 deleteById(String resourceGroupName, String applicationDefinitionName); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 deleteByIdWithResponse(String resourceGroupName, String applicationDefinitionName, Context context); + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationDefinitionInner createOrUpdateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters); + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + Context context); + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationDefinitionInner updateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters); + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable parameters, + Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationsClient.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationsClient.java new file mode 100644 index 000000000000..3931cfab603e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationsClient.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.models.AllowedUpgradePlansResultInner; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationPatchable; +import com.azure.resourcemanager.solutions.models.ListTokenRequest; + +/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +public interface ApplicationsClient { + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner getByResourceGroup(String resourceGroupName, String applicationName); + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationName, Context context); + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName); + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context); + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName); + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context); + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginCreateOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters); + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginCreateOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters, Context context); + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner createOrUpdate(String resourceGroupName, String applicationName, ApplicationInner parameters); + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner createOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters, Context context); + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginUpdate( + String resourceGroupName, String applicationName, ApplicationPatchable parameters); + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginUpdate( + String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context); + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner update(String resourceGroupName, String applicationName, ApplicationPatchable parameters); + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner update(String resourceGroupName, String applicationName); + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner update( + String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context); + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner getById(String applicationId); + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String applicationId, Context context); + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteById(String applicationId); + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteById(String applicationId, Context context); + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteById(String applicationId); + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteById(String applicationId, Context context); + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginCreateOrUpdateById( + String applicationId, ApplicationInner parameters); + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginCreateOrUpdateById( + String applicationId, ApplicationInner parameters, Context context); + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner createOrUpdateById(String applicationId, ApplicationInner parameters); + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner createOrUpdateById(String applicationId, ApplicationInner parameters, Context context); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginUpdateById( + String applicationId, ApplicationPatchable parameters); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationInner> beginUpdateById( + String applicationId, ApplicationPatchable parameters, Context context); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner updateById(String applicationId, ApplicationPatchable parameters); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner updateById(String applicationId); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner updateById(String applicationId, ApplicationPatchable parameters, Context context); + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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> beginRefreshPermissions(String resourceGroupName, String applicationName); + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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> beginRefreshPermissions( + String resourceGroupName, String applicationName, Context context); + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 refreshPermissions(String resourceGroupName, String applicationName); + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 refreshPermissions(String resourceGroupName, String applicationName, Context context); + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 array of plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AllowedUpgradePlansResultInner listAllowedUpgradePlans(String resourceGroupName, String applicationName); + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 array of plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAllowedUpgradePlansWithResponse( + String resourceGroupName, String applicationName, Context context); + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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, UpdateAccessDefinitionInner> beginUpdateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters); + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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, UpdateAccessDefinitionInner> beginUpdateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context); + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateAccessDefinitionInner updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters); + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateAccessDefinitionInner updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context); + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedIdentityTokenResultInner listTokens( + String resourceGroupName, String applicationName, ListTokenRequest parameters); + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listTokensWithResponse( + String resourceGroupName, String applicationName, ListTokenRequest parameters, Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/JitRequestsClient.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/JitRequestsClient.java new file mode 100644 index 000000000000..ba63df0c8d3b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/JitRequestsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionInner; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionListResultInner; +import com.azure.resourcemanager.solutions.models.JitRequestPatchable; + +/** An instance of this class provides access to all the operations defined in JitRequestsClient. */ +public interface JitRequestsClient { + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 JIT request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JitRequestDefinitionInner getByResourceGroup(String resourceGroupName, String jitRequestName); + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 JIT request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String jitRequestName, Context context); + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 information about JIT request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JitRequestDefinitionInner> beginCreateOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters); + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 information about JIT request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JitRequestDefinitionInner> beginCreateOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters, Context context); + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JitRequestDefinitionInner createOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters); + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JitRequestDefinitionInner createOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters, Context context); + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JitRequestDefinitionInner update(String resourceGroupName, String jitRequestName, JitRequestPatchable parameters); + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String jitRequestName, JitRequestPatchable parameters, Context context); + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 jitRequestName); + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 jitRequestName, Context context); + + /** + * Lists all JIT requests within the 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 list of JIT requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JitRequestDefinitionListResultInner listBySubscription(); + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listBySubscriptionWithResponse(Context context); + + /** + * Lists all JIT requests within the 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 list of JIT requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JitRequestDefinitionListResultInner listByResourceGroup(String resourceGroupName); + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceGroupWithResponse( + String resourceGroupName, Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ManagedApplicationManagementClient.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ManagedApplicationManagementClient.java new file mode 100644 index 000000000000..41ab4b372c43 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ManagedApplicationManagementClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ManagedApplicationManagementClient class. */ +public interface ManagedApplicationManagementClient { + /** + * 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 ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + ApplicationsClient getApplications(); + + /** + * Gets the ApplicationDefinitionsClient object to access its operations. + * + * @return the ApplicationDefinitionsClient object. + */ + ApplicationDefinitionsClient getApplicationDefinitions(); + + /** + * Gets the JitRequestsClient object to access its operations. + * + * @return the JitRequestsClient object. + */ + JitRequestsClient getJitRequests(); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ResourceProvidersClient.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ResourceProvidersClient.java new file mode 100644 index 000000000000..0550edf344a9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ResourceProvidersClient.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.solutions.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.solutions.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Lists all of the available Microsoft.Solutions 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 listOperations(); + + /** + * Lists all of the available Microsoft.Solutions 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 listOperations(Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/AllowedUpgradePlansResultInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/AllowedUpgradePlansResultInner.java new file mode 100644 index 000000000000..970024dd532a --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/AllowedUpgradePlansResultInner.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.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.models.Plan; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The array of plan. */ +@Fluent +public final class AllowedUpgradePlansResultInner { + /* + * The array of plans. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The array of plans. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The array of plans. + * + * @param value the value value to set. + * @return the AllowedUpgradePlansResultInner object itself. + */ + public AllowedUpgradePlansResultInner 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionInner.java new file mode 100644 index 000000000000..8196f2852801 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionInner.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionArtifact; +import com.azure.resourcemanager.solutions.models.ApplicationDeploymentPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import com.azure.resourcemanager.solutions.models.ApplicationManagementPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationNotificationPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationPackageLockingPolicyDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationPolicy; +import com.azure.resourcemanager.solutions.models.GenericResource; +import com.azure.resourcemanager.solutions.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about managed application definition. */ +@Fluent +public final class ApplicationDefinitionInner extends GenericResource { + /* + * The managed application definition properties. + */ + @JsonProperty(value = "properties", required = true) + private ApplicationDefinitionProperties innerProperties = new ApplicationDefinitionProperties(); + + /** + * Get the innerProperties property: The managed application definition properties. + * + * @return the innerProperties value. + */ + private ApplicationDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ApplicationDefinitionInner withManagedBy(String managedBy) { + super.withManagedBy(managedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationDefinitionInner withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationDefinitionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationDefinitionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the lockLevel property: The managed application lock level. + * + * @return the lockLevel value. + */ + public ApplicationLockLevel lockLevel() { + return this.innerProperties() == null ? null : this.innerProperties().lockLevel(); + } + + /** + * Set the lockLevel property: The managed application lock level. + * + * @param lockLevel the lockLevel value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withLockLevel(ApplicationLockLevel lockLevel) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withLockLevel(lockLevel); + return this; + } + + /** + * Get the displayName property: The managed application definition display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The managed application definition display name. + * + * @param displayName the displayName value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the isEnabled property: A value indicating whether the package is enabled or not. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Set the isEnabled property: A value indicating whether the package is enabled or not. + * + * @param isEnabled the isEnabled value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withIsEnabled(Boolean isEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the authorizations property: The managed application provider authorizations. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.innerProperties() == null ? null : this.innerProperties().authorizations(); + } + + /** + * Set the authorizations property: The managed application provider authorizations. + * + * @param authorizations the authorizations value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withAuthorizations(List authorizations) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withAuthorizations(authorizations); + return this; + } + + /** + * Get the artifacts property: The collection of managed application artifacts. The portal will use the files + * specified as artifacts to construct the user experience of creating a managed application from a managed + * application definition. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); + } + + /** + * Set the artifacts property: The collection of managed application artifacts. The portal will use the files + * specified as artifacts to construct the user experience of creating a managed application from a managed + * application definition. + * + * @param artifacts the artifacts value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withArtifacts(List artifacts) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withArtifacts(artifacts); + return this; + } + + /** + * Get the description property: The managed application definition description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The managed application definition description. + * + * @param description the description value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the packageFileUri property: The managed application definition package file Uri. Use this element. + * + * @return the packageFileUri value. + */ + public String packageFileUri() { + return this.innerProperties() == null ? null : this.innerProperties().packageFileUri(); + } + + /** + * Set the packageFileUri property: The managed application definition package file Uri. Use this element. + * + * @param packageFileUri the packageFileUri value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withPackageFileUri(String packageFileUri) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withPackageFileUri(packageFileUri); + return this; + } + + /** + * Get the storageAccountId property: The storage account id for bring your own storage scenario. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountId(); + } + + /** + * Set the storageAccountId property: The storage account id for bring your own storage scenario. + * + * @param storageAccountId the storageAccountId value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withStorageAccountId(String storageAccountId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withStorageAccountId(storageAccountId); + return this; + } + + /** + * Get the mainTemplate property: The inline main template json which has resources to be provisioned. It can be a + * JObject or well-formed JSON string. + * + * @return the mainTemplate value. + */ + public Object mainTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().mainTemplate(); + } + + /** + * Set the mainTemplate property: The inline main template json which has resources to be provisioned. It can be a + * JObject or well-formed JSON string. + * + * @param mainTemplate the mainTemplate value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withMainTemplate(Object mainTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withMainTemplate(mainTemplate); + return this; + } + + /** + * Get the createUiDefinition property: The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. + * + * @return the createUiDefinition value. + */ + public Object createUiDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().createUiDefinition(); + } + + /** + * Set the createUiDefinition property: The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. + * + * @param createUiDefinition the createUiDefinition value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withCreateUiDefinition(Object createUiDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withCreateUiDefinition(createUiDefinition); + return this; + } + + /** + * Get the notificationPolicy property: The managed application notification policy. + * + * @return the notificationPolicy value. + */ + public ApplicationNotificationPolicy notificationPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().notificationPolicy(); + } + + /** + * Set the notificationPolicy property: The managed application notification policy. + * + * @param notificationPolicy the notificationPolicy value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withNotificationPolicy(ApplicationNotificationPolicy notificationPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withNotificationPolicy(notificationPolicy); + return this; + } + + /** + * Get the lockingPolicy property: The managed application locking policy. + * + * @return the lockingPolicy value. + */ + public ApplicationPackageLockingPolicyDefinition lockingPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().lockingPolicy(); + } + + /** + * Set the lockingPolicy property: The managed application locking policy. + * + * @param lockingPolicy the lockingPolicy value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withLockingPolicy(ApplicationPackageLockingPolicyDefinition lockingPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withLockingPolicy(lockingPolicy); + return this; + } + + /** + * Get the deploymentPolicy property: The managed application deployment policy. + * + * @return the deploymentPolicy value. + */ + public ApplicationDeploymentPolicy deploymentPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentPolicy(); + } + + /** + * Set the deploymentPolicy property: The managed application deployment policy. + * + * @param deploymentPolicy the deploymentPolicy value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withDeploymentPolicy(ApplicationDeploymentPolicy deploymentPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withDeploymentPolicy(deploymentPolicy); + return this; + } + + /** + * Get the managementPolicy property: The managed application management policy that determines publisher's access + * to the managed resource group. + * + * @return the managementPolicy value. + */ + public ApplicationManagementPolicy managementPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().managementPolicy(); + } + + /** + * Set the managementPolicy property: The managed application management policy that determines publisher's access + * to the managed resource group. + * + * @param managementPolicy the managementPolicy value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withManagementPolicy(ApplicationManagementPolicy managementPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withManagementPolicy(managementPolicy); + return this; + } + + /** + * Get the policies property: The managed application provider policies. + * + * @return the policies value. + */ + public List policies() { + return this.innerProperties() == null ? null : this.innerProperties().policies(); + } + + /** + * Set the policies property: The managed application provider policies. + * + * @param policies the policies value to set. + * @return the ApplicationDefinitionInner object itself. + */ + public ApplicationDefinitionInner withPolicies(List policies) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationDefinitionProperties(); + } + this.innerProperties().withPolicies(policies); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ApplicationDefinitionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationDefinitionInner.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionProperties.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionProperties.java new file mode 100644 index 000000000000..034f8b6b5d9e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionProperties.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionArtifact; +import com.azure.resourcemanager.solutions.models.ApplicationDeploymentPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import com.azure.resourcemanager.solutions.models.ApplicationManagementPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationNotificationPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationPackageLockingPolicyDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The managed application definition properties. */ +@Fluent +public final class ApplicationDefinitionProperties { + /* + * The managed application lock level. + */ + @JsonProperty(value = "lockLevel", required = true) + private ApplicationLockLevel lockLevel; + + /* + * The managed application definition display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * A value indicating whether the package is enabled or not. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * The managed application provider authorizations. + */ + @JsonProperty(value = "authorizations") + private List authorizations; + + /* + * The collection of managed application artifacts. The portal will use the files specified as artifacts to + * construct the user experience of creating a managed application from a managed application definition. + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /* + * The managed application definition description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The managed application definition package file Uri. Use this element + */ + @JsonProperty(value = "packageFileUri") + private String packageFileUri; + + /* + * The storage account id for bring your own storage scenario. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The inline main template json which has resources to be provisioned. It can be a JObject or well-formed JSON + * string. + */ + @JsonProperty(value = "mainTemplate") + private Object mainTemplate; + + /* + * The createUiDefinition json for the backing template with Microsoft.Solutions/applications resource. It can be a + * JObject or well-formed JSON string. + */ + @JsonProperty(value = "createUiDefinition") + private Object createUiDefinition; + + /* + * The managed application notification policy. + */ + @JsonProperty(value = "notificationPolicy") + private ApplicationNotificationPolicy notificationPolicy; + + /* + * The managed application locking policy. + */ + @JsonProperty(value = "lockingPolicy") + private ApplicationPackageLockingPolicyDefinition lockingPolicy; + + /* + * The managed application deployment policy. + */ + @JsonProperty(value = "deploymentPolicy") + private ApplicationDeploymentPolicy deploymentPolicy; + + /* + * The managed application management policy that determines publisher's access to the managed resource group. + */ + @JsonProperty(value = "managementPolicy") + private ApplicationManagementPolicy managementPolicy; + + /* + * The managed application provider policies. + */ + @JsonProperty(value = "policies") + private List policies; + + /** + * Get the lockLevel property: The managed application lock level. + * + * @return the lockLevel value. + */ + public ApplicationLockLevel lockLevel() { + return this.lockLevel; + } + + /** + * Set the lockLevel property: The managed application lock level. + * + * @param lockLevel the lockLevel value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withLockLevel(ApplicationLockLevel lockLevel) { + this.lockLevel = lockLevel; + return this; + } + + /** + * Get the displayName property: The managed application definition display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The managed application definition display name. + * + * @param displayName the displayName value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the isEnabled property: A value indicating whether the package is enabled or not. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: A value indicating whether the package is enabled or not. + * + * @param isEnabled the isEnabled value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the authorizations property: The managed application provider authorizations. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Set the authorizations property: The managed application provider authorizations. + * + * @param authorizations the authorizations value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withAuthorizations(List authorizations) { + this.authorizations = authorizations; + return this; + } + + /** + * Get the artifacts property: The collection of managed application artifacts. The portal will use the files + * specified as artifacts to construct the user experience of creating a managed application from a managed + * application definition. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: The collection of managed application artifacts. The portal will use the files + * specified as artifacts to construct the user experience of creating a managed application from a managed + * application definition. + * + * @param artifacts the artifacts value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the description property: The managed application definition description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The managed application definition description. + * + * @param description the description value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the packageFileUri property: The managed application definition package file Uri. Use this element. + * + * @return the packageFileUri value. + */ + public String packageFileUri() { + return this.packageFileUri; + } + + /** + * Set the packageFileUri property: The managed application definition package file Uri. Use this element. + * + * @param packageFileUri the packageFileUri value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withPackageFileUri(String packageFileUri) { + this.packageFileUri = packageFileUri; + return this; + } + + /** + * Get the storageAccountId property: The storage account id for bring your own storage scenario. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The storage account id for bring your own storage scenario. + * + * @param storageAccountId the storageAccountId value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the mainTemplate property: The inline main template json which has resources to be provisioned. It can be a + * JObject or well-formed JSON string. + * + * @return the mainTemplate value. + */ + public Object mainTemplate() { + return this.mainTemplate; + } + + /** + * Set the mainTemplate property: The inline main template json which has resources to be provisioned. It can be a + * JObject or well-formed JSON string. + * + * @param mainTemplate the mainTemplate value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withMainTemplate(Object mainTemplate) { + this.mainTemplate = mainTemplate; + return this; + } + + /** + * Get the createUiDefinition property: The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. + * + * @return the createUiDefinition value. + */ + public Object createUiDefinition() { + return this.createUiDefinition; + } + + /** + * Set the createUiDefinition property: The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. + * + * @param createUiDefinition the createUiDefinition value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withCreateUiDefinition(Object createUiDefinition) { + this.createUiDefinition = createUiDefinition; + return this; + } + + /** + * Get the notificationPolicy property: The managed application notification policy. + * + * @return the notificationPolicy value. + */ + public ApplicationNotificationPolicy notificationPolicy() { + return this.notificationPolicy; + } + + /** + * Set the notificationPolicy property: The managed application notification policy. + * + * @param notificationPolicy the notificationPolicy value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withNotificationPolicy(ApplicationNotificationPolicy notificationPolicy) { + this.notificationPolicy = notificationPolicy; + return this; + } + + /** + * Get the lockingPolicy property: The managed application locking policy. + * + * @return the lockingPolicy value. + */ + public ApplicationPackageLockingPolicyDefinition lockingPolicy() { + return this.lockingPolicy; + } + + /** + * Set the lockingPolicy property: The managed application locking policy. + * + * @param lockingPolicy the lockingPolicy value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withLockingPolicy(ApplicationPackageLockingPolicyDefinition lockingPolicy) { + this.lockingPolicy = lockingPolicy; + return this; + } + + /** + * Get the deploymentPolicy property: The managed application deployment policy. + * + * @return the deploymentPolicy value. + */ + public ApplicationDeploymentPolicy deploymentPolicy() { + return this.deploymentPolicy; + } + + /** + * Set the deploymentPolicy property: The managed application deployment policy. + * + * @param deploymentPolicy the deploymentPolicy value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withDeploymentPolicy(ApplicationDeploymentPolicy deploymentPolicy) { + this.deploymentPolicy = deploymentPolicy; + return this; + } + + /** + * Get the managementPolicy property: The managed application management policy that determines publisher's access + * to the managed resource group. + * + * @return the managementPolicy value. + */ + public ApplicationManagementPolicy managementPolicy() { + return this.managementPolicy; + } + + /** + * Set the managementPolicy property: The managed application management policy that determines publisher's access + * to the managed resource group. + * + * @param managementPolicy the managementPolicy value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withManagementPolicy(ApplicationManagementPolicy managementPolicy) { + this.managementPolicy = managementPolicy; + return this; + } + + /** + * Get the policies property: The managed application provider policies. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The managed application provider policies. + * + * @param policies the policies value to set. + * @return the ApplicationDefinitionProperties object itself. + */ + public ApplicationDefinitionProperties withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lockLevel() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lockLevel in model ApplicationDefinitionProperties")); + } + if (authorizations() != null) { + authorizations().forEach(e -> e.validate()); + } + if (artifacts() != null) { + artifacts().forEach(e -> e.validate()); + } + if (notificationPolicy() != null) { + notificationPolicy().validate(); + } + if (lockingPolicy() != null) { + lockingPolicy().validate(); + } + if (deploymentPolicy() != null) { + deploymentPolicy().validate(); + } + if (managementPolicy() != null) { + managementPolicy().validate(); + } + if (policies() != null) { + policies().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationDefinitionProperties.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationInner.java new file mode 100644 index 000000000000..083c4407d6f1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationInner.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.solutions.models.ApplicationArtifact; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationBillingDetailsDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationClientDetails; +import com.azure.resourcemanager.solutions.models.ApplicationJitAccessPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationManagementMode; +import com.azure.resourcemanager.solutions.models.ApplicationPackageContact; +import com.azure.resourcemanager.solutions.models.ApplicationPackageSupportUrls; +import com.azure.resourcemanager.solutions.models.GenericResource; +import com.azure.resourcemanager.solutions.models.Identity; +import com.azure.resourcemanager.solutions.models.Plan; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import com.azure.resourcemanager.solutions.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about managed application. */ +@Fluent +public final class ApplicationInner extends GenericResource { + /* + * The managed application properties. + */ + @JsonProperty(value = "properties", required = true) + private ApplicationProperties innerProperties = new ApplicationProperties(); + + /* + * The plan information. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + */ + @JsonProperty(value = "kind", required = true) + private String kind; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Get the innerProperties property: The managed application properties. + * + * @return the innerProperties value. + */ + private ApplicationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the plan property: The plan information. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: The plan information. + * + * @param plan the plan value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the kind property: The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * + * @param kind the kind value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationInner withManagedBy(String managedBy) { + super.withManagedBy(managedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationInner withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the managedResourceGroupId property: The managed resource group Id. + * + * @return the managedResourceGroupId value. + */ + public String managedResourceGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupId(); + } + + /** + * Set the managedResourceGroupId property: The managed resource group Id. + * + * @param managedResourceGroupId the managedResourceGroupId value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withManagedResourceGroupId(String managedResourceGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withManagedResourceGroupId(managedResourceGroupId); + return this; + } + + /** + * Get the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @return the applicationDefinitionId value. + */ + public String applicationDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().applicationDefinitionId(); + } + + /** + * Set the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @param applicationDefinitionId the applicationDefinitionId value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withApplicationDefinitionId(String applicationDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withApplicationDefinitionId(applicationDefinitionId); + return this; + } + + /** + * Get the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @return the parameters value. + */ + public Object parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @param parameters the parameters value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withParameters(Object parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the outputs property: Name and value pairs that define the managed application outputs. + * + * @return the outputs value. + */ + public Object outputs() { + return this.innerProperties() == null ? null : this.innerProperties().outputs(); + } + + /** + * Get the provisioningState property: The managed application provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the billingDetails property: The managed application billing details. + * + * @return the billingDetails value. + */ + public ApplicationBillingDetailsDefinition billingDetails() { + return this.innerProperties() == null ? null : this.innerProperties().billingDetails(); + } + + /** + * Get the jitAccessPolicy property: The managed application Jit access policy. + * + * @return the jitAccessPolicy value. + */ + public ApplicationJitAccessPolicy jitAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().jitAccessPolicy(); + } + + /** + * Set the jitAccessPolicy property: The managed application Jit access policy. + * + * @param jitAccessPolicy the jitAccessPolicy value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withJitAccessPolicy(jitAccessPolicy); + return this; + } + + /** + * Get the publisherTenantId property: The publisher tenant Id. + * + * @return the publisherTenantId value. + */ + public String publisherTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherTenantId(); + } + + /** + * Get the authorizations property: The read-only authorizations property that is retrieved from the application + * package. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.innerProperties() == null ? null : this.innerProperties().authorizations(); + } + + /** + * Get the managementMode property: The managed application management mode. + * + * @return the managementMode value. + */ + public ApplicationManagementMode managementMode() { + return this.innerProperties() == null ? null : this.innerProperties().managementMode(); + } + + /** + * Get the customerSupport property: The read-only customer support property that is retrieved from the application + * package. + * + * @return the customerSupport value. + */ + public ApplicationPackageContact customerSupport() { + return this.innerProperties() == null ? null : this.innerProperties().customerSupport(); + } + + /** + * Get the supportUrls property: The read-only support URLs property that is retrieved from the application package. + * + * @return the supportUrls value. + */ + public ApplicationPackageSupportUrls supportUrls() { + return this.innerProperties() == null ? null : this.innerProperties().supportUrls(); + } + + /** + * Get the artifacts property: The collection of managed application artifacts. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); + } + + /** + * Get the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + public ApplicationClientDetails createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + public ApplicationClientDetails updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ApplicationInner")); + } else { + innerProperties().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (kind() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model ApplicationInner")); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationInner.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationProperties.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationProperties.java new file mode 100644 index 000000000000..444aa3ae478f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationProperties.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.models.ApplicationArtifact; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationBillingDetailsDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationClientDetails; +import com.azure.resourcemanager.solutions.models.ApplicationJitAccessPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationManagementMode; +import com.azure.resourcemanager.solutions.models.ApplicationPackageContact; +import com.azure.resourcemanager.solutions.models.ApplicationPackageSupportUrls; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The managed application properties. */ +@Fluent +public final class ApplicationProperties { + /* + * The managed resource group Id. + */ + @JsonProperty(value = "managedResourceGroupId") + private String managedResourceGroupId; + + /* + * The fully qualified path of managed application definition Id. + */ + @JsonProperty(value = "applicationDefinitionId") + private String applicationDefinitionId; + + /* + * Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON + * string. + */ + @JsonProperty(value = "parameters") + private Object parameters; + + /* + * Name and value pairs that define the managed application outputs. + */ + @JsonProperty(value = "outputs", access = JsonProperty.Access.WRITE_ONLY) + private Object outputs; + + /* + * The managed application provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The managed application billing details. + */ + @JsonProperty(value = "billingDetails", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationBillingDetailsDefinition billingDetails; + + /* + * The managed application Jit access policy. + */ + @JsonProperty(value = "jitAccessPolicy") + private ApplicationJitAccessPolicy jitAccessPolicy; + + /* + * The publisher tenant Id. + */ + @JsonProperty(value = "publisherTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String publisherTenantId; + + /* + * The read-only authorizations property that is retrieved from the application package. + */ + @JsonProperty(value = "authorizations", access = JsonProperty.Access.WRITE_ONLY) + private List authorizations; + + /* + * The managed application management mode. + */ + @JsonProperty(value = "managementMode", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationManagementMode managementMode; + + /* + * The read-only customer support property that is retrieved from the application package. + */ + @JsonProperty(value = "customerSupport", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationPackageContact customerSupport; + + /* + * The read-only support URLs property that is retrieved from the application package. + */ + @JsonProperty(value = "supportUrls", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationPackageSupportUrls supportUrls; + + /* + * The collection of managed application artifacts. + */ + @JsonProperty(value = "artifacts", access = JsonProperty.Access.WRITE_ONLY) + private List artifacts; + + /* + * The client entity that created the JIT request. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationClientDetails createdBy; + + /* + * The client entity that last updated the JIT request. + */ + @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationClientDetails updatedBy; + + /** + * Get the managedResourceGroupId property: The managed resource group Id. + * + * @return the managedResourceGroupId value. + */ + public String managedResourceGroupId() { + return this.managedResourceGroupId; + } + + /** + * Set the managedResourceGroupId property: The managed resource group Id. + * + * @param managedResourceGroupId the managedResourceGroupId value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withManagedResourceGroupId(String managedResourceGroupId) { + this.managedResourceGroupId = managedResourceGroupId; + return this; + } + + /** + * Get the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @return the applicationDefinitionId value. + */ + public String applicationDefinitionId() { + return this.applicationDefinitionId; + } + + /** + * Set the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @param applicationDefinitionId the applicationDefinitionId value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationDefinitionId(String applicationDefinitionId) { + this.applicationDefinitionId = applicationDefinitionId; + return this; + } + + /** + * Get the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @param parameters the parameters value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withParameters(Object parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the outputs property: Name and value pairs that define the managed application outputs. + * + * @return the outputs value. + */ + public Object outputs() { + return this.outputs; + } + + /** + * Get the provisioningState property: The managed application provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the billingDetails property: The managed application billing details. + * + * @return the billingDetails value. + */ + public ApplicationBillingDetailsDefinition billingDetails() { + return this.billingDetails; + } + + /** + * Get the jitAccessPolicy property: The managed application Jit access policy. + * + * @return the jitAccessPolicy value. + */ + public ApplicationJitAccessPolicy jitAccessPolicy() { + return this.jitAccessPolicy; + } + + /** + * Set the jitAccessPolicy property: The managed application Jit access policy. + * + * @param jitAccessPolicy the jitAccessPolicy value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy) { + this.jitAccessPolicy = jitAccessPolicy; + return this; + } + + /** + * Get the publisherTenantId property: The publisher tenant Id. + * + * @return the publisherTenantId value. + */ + public String publisherTenantId() { + return this.publisherTenantId; + } + + /** + * Get the authorizations property: The read-only authorizations property that is retrieved from the application + * package. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Get the managementMode property: The managed application management mode. + * + * @return the managementMode value. + */ + public ApplicationManagementMode managementMode() { + return this.managementMode; + } + + /** + * Get the customerSupport property: The read-only customer support property that is retrieved from the application + * package. + * + * @return the customerSupport value. + */ + public ApplicationPackageContact customerSupport() { + return this.customerSupport; + } + + /** + * Get the supportUrls property: The read-only support URLs property that is retrieved from the application package. + * + * @return the supportUrls value. + */ + public ApplicationPackageSupportUrls supportUrls() { + return this.supportUrls; + } + + /** + * Get the artifacts property: The collection of managed application artifacts. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Get the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + public ApplicationClientDetails createdBy() { + return this.createdBy; + } + + /** + * Get the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + public ApplicationClientDetails updatedBy() { + return this.updatedBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (billingDetails() != null) { + billingDetails().validate(); + } + if (jitAccessPolicy() != null) { + jitAccessPolicy().validate(); + } + if (authorizations() != null) { + authorizations().forEach(e -> e.validate()); + } + if (customerSupport() != null) { + customerSupport().validate(); + } + if (supportUrls() != null) { + supportUrls().validate(); + } + if (artifacts() != null) { + artifacts().forEach(e -> e.validate()); + } + if (createdBy() != null) { + createdBy().validate(); + } + if (updatedBy() != null) { + updatedBy().validate(); + } + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionInner.java new file mode 100644 index 000000000000..69459bbb5c64 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionInner.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.solutions.models.ApplicationClientDetails; +import com.azure.resourcemanager.solutions.models.JitAuthorizationPolicies; +import com.azure.resourcemanager.solutions.models.JitRequestState; +import com.azure.resourcemanager.solutions.models.JitSchedulingPolicy; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about JIT request definition. */ +@Fluent +public final class JitRequestDefinitionInner extends Resource { + /* + * The JIT request properties. + */ + @JsonProperty(value = "properties") + private JitRequestProperties 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 JIT request properties. + * + * @return the innerProperties value. + */ + private JitRequestProperties 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 JitRequestDefinitionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public JitRequestDefinitionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the applicationResourceId property: The parent application id. + * + * @return the applicationResourceId value. + */ + public String applicationResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().applicationResourceId(); + } + + /** + * Set the applicationResourceId property: The parent application id. + * + * @param applicationResourceId the applicationResourceId value to set. + * @return the JitRequestDefinitionInner object itself. + */ + public JitRequestDefinitionInner withApplicationResourceId(String applicationResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new JitRequestProperties(); + } + this.innerProperties().withApplicationResourceId(applicationResourceId); + return this; + } + + /** + * Get the publisherTenantId property: The publisher tenant id. + * + * @return the publisherTenantId value. + */ + public String publisherTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherTenantId(); + } + + /** + * Get the jitAuthorizationPolicies property: The JIT authorization policies. + * + * @return the jitAuthorizationPolicies value. + */ + public List jitAuthorizationPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().jitAuthorizationPolicies(); + } + + /** + * Set the jitAuthorizationPolicies property: The JIT authorization policies. + * + * @param jitAuthorizationPolicies the jitAuthorizationPolicies value to set. + * @return the JitRequestDefinitionInner object itself. + */ + public JitRequestDefinitionInner withJitAuthorizationPolicies( + List jitAuthorizationPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new JitRequestProperties(); + } + this.innerProperties().withJitAuthorizationPolicies(jitAuthorizationPolicies); + return this; + } + + /** + * Get the jitSchedulingPolicy property: The JIT request properties. + * + * @return the jitSchedulingPolicy value. + */ + public JitSchedulingPolicy jitSchedulingPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().jitSchedulingPolicy(); + } + + /** + * Set the jitSchedulingPolicy property: The JIT request properties. + * + * @param jitSchedulingPolicy the jitSchedulingPolicy value to set. + * @return the JitRequestDefinitionInner object itself. + */ + public JitRequestDefinitionInner withJitSchedulingPolicy(JitSchedulingPolicy jitSchedulingPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new JitRequestProperties(); + } + this.innerProperties().withJitSchedulingPolicy(jitSchedulingPolicy); + return this; + } + + /** + * Get the provisioningState property: The JIT request provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the jitRequestState property: The JIT request state. + * + * @return the jitRequestState value. + */ + public JitRequestState jitRequestState() { + return this.innerProperties() == null ? null : this.innerProperties().jitRequestState(); + } + + /** + * Get the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + public ApplicationClientDetails createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + public ApplicationClientDetails updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionListResultInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionListResultInner.java new file mode 100644 index 000000000000..0860e824ae51 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionListResultInner.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.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of JIT requests. */ +@Fluent +public final class JitRequestDefinitionListResultInner { + /* + * The array of Jit request definition. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The array of Jit request definition. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The array of Jit request definition. + * + * @param value the value value to set. + * @return the JitRequestDefinitionListResultInner object itself. + */ + public JitRequestDefinitionListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the JitRequestDefinitionListResultInner object itself. + */ + public JitRequestDefinitionListResultInner 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestProperties.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestProperties.java new file mode 100644 index 000000000000..27492a92081d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.solutions.models.ApplicationClientDetails; +import com.azure.resourcemanager.solutions.models.JitAuthorizationPolicies; +import com.azure.resourcemanager.solutions.models.JitRequestState; +import com.azure.resourcemanager.solutions.models.JitSchedulingPolicy; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about JIT request properties. */ +@Fluent +public final class JitRequestProperties { + /* + * The parent application id. + */ + @JsonProperty(value = "applicationResourceId", required = true) + private String applicationResourceId; + + /* + * The publisher tenant id. + */ + @JsonProperty(value = "publisherTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String publisherTenantId; + + /* + * The JIT authorization policies. + */ + @JsonProperty(value = "jitAuthorizationPolicies", required = true) + private List jitAuthorizationPolicies; + + /* + * The JIT request properties. + */ + @JsonProperty(value = "jitSchedulingPolicy", required = true) + private JitSchedulingPolicy jitSchedulingPolicy; + + /* + * The JIT request provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The JIT request state. + */ + @JsonProperty(value = "jitRequestState", access = JsonProperty.Access.WRITE_ONLY) + private JitRequestState jitRequestState; + + /* + * The client entity that created the JIT request. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationClientDetails createdBy; + + /* + * The client entity that last updated the JIT request. + */ + @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationClientDetails updatedBy; + + /** + * Get the applicationResourceId property: The parent application id. + * + * @return the applicationResourceId value. + */ + public String applicationResourceId() { + return this.applicationResourceId; + } + + /** + * Set the applicationResourceId property: The parent application id. + * + * @param applicationResourceId the applicationResourceId value to set. + * @return the JitRequestProperties object itself. + */ + public JitRequestProperties withApplicationResourceId(String applicationResourceId) { + this.applicationResourceId = applicationResourceId; + return this; + } + + /** + * Get the publisherTenantId property: The publisher tenant id. + * + * @return the publisherTenantId value. + */ + public String publisherTenantId() { + return this.publisherTenantId; + } + + /** + * Get the jitAuthorizationPolicies property: The JIT authorization policies. + * + * @return the jitAuthorizationPolicies value. + */ + public List jitAuthorizationPolicies() { + return this.jitAuthorizationPolicies; + } + + /** + * Set the jitAuthorizationPolicies property: The JIT authorization policies. + * + * @param jitAuthorizationPolicies the jitAuthorizationPolicies value to set. + * @return the JitRequestProperties object itself. + */ + public JitRequestProperties withJitAuthorizationPolicies(List jitAuthorizationPolicies) { + this.jitAuthorizationPolicies = jitAuthorizationPolicies; + return this; + } + + /** + * Get the jitSchedulingPolicy property: The JIT request properties. + * + * @return the jitSchedulingPolicy value. + */ + public JitSchedulingPolicy jitSchedulingPolicy() { + return this.jitSchedulingPolicy; + } + + /** + * Set the jitSchedulingPolicy property: The JIT request properties. + * + * @param jitSchedulingPolicy the jitSchedulingPolicy value to set. + * @return the JitRequestProperties object itself. + */ + public JitRequestProperties withJitSchedulingPolicy(JitSchedulingPolicy jitSchedulingPolicy) { + this.jitSchedulingPolicy = jitSchedulingPolicy; + return this; + } + + /** + * Get the provisioningState property: The JIT request provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the jitRequestState property: The JIT request state. + * + * @return the jitRequestState value. + */ + public JitRequestState jitRequestState() { + return this.jitRequestState; + } + + /** + * Get the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + public ApplicationClientDetails createdBy() { + return this.createdBy; + } + + /** + * Get the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + public ApplicationClientDetails updatedBy() { + return this.updatedBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationResourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationResourceId in model JitRequestProperties")); + } + if (jitAuthorizationPolicies() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property jitAuthorizationPolicies in model JitRequestProperties")); + } else { + jitAuthorizationPolicies().forEach(e -> e.validate()); + } + if (jitSchedulingPolicy() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property jitSchedulingPolicy in model JitRequestProperties")); + } else { + jitSchedulingPolicy().validate(); + } + if (createdBy() != null) { + createdBy().validate(); + } + if (updatedBy() != null) { + updatedBy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JitRequestProperties.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ManagedIdentityTokenResultInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ManagedIdentityTokenResultInner.java new file mode 100644 index 000000000000..354a87a40a63 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ManagedIdentityTokenResultInner.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.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.models.ManagedIdentityToken; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The array of managed identity tokens. */ +@Fluent +public final class ManagedIdentityTokenResultInner { + /* + * The array of managed identity tokens. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The array of managed identity tokens. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The array of managed identity tokens. + * + * @param value the value value to set. + * @return the ManagedIdentityTokenResultInner object itself. + */ + public ManagedIdentityTokenResultInner 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/OperationInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/OperationInner.java new file mode 100644 index 000000000000..30f9f623db23 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/OperationInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.models.ActionType; +import com.azure.resourcemanager.solutions.models.OperationDisplay; +import com.azure.resourcemanager.solutions.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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/UpdateAccessDefinitionInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/UpdateAccessDefinitionInner.java new file mode 100644 index 000000000000..35bbccfffafb --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/UpdateAccessDefinitionInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.solutions.models.JitRequestMetadata; +import com.azure.resourcemanager.solutions.models.Status; +import com.azure.resourcemanager.solutions.models.Substatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update access request definition. */ +@Fluent +public final class UpdateAccessDefinitionInner { + /* + * The approver name. + */ + @JsonProperty(value = "approver") + private String approver; + + /* + * The JIT request metadata. + */ + @JsonProperty(value = "metadata", required = true) + private JitRequestMetadata metadata; + + /* + * The JIT status. + */ + @JsonProperty(value = "status", required = true) + private Status status; + + /* + * The JIT status. + */ + @JsonProperty(value = "subStatus", required = true) + private Substatus subStatus; + + /** + * Get the approver property: The approver name. + * + * @return the approver value. + */ + public String approver() { + return this.approver; + } + + /** + * Set the approver property: The approver name. + * + * @param approver the approver value to set. + * @return the UpdateAccessDefinitionInner object itself. + */ + public UpdateAccessDefinitionInner withApprover(String approver) { + this.approver = approver; + return this; + } + + /** + * Get the metadata property: The JIT request metadata. + * + * @return the metadata value. + */ + public JitRequestMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The JIT request metadata. + * + * @param metadata the metadata value to set. + * @return the UpdateAccessDefinitionInner object itself. + */ + public UpdateAccessDefinitionInner withMetadata(JitRequestMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the status property: The JIT status. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The JIT status. + * + * @param status the status value to set. + * @return the UpdateAccessDefinitionInner object itself. + */ + public UpdateAccessDefinitionInner withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the subStatus property: The JIT status. + * + * @return the subStatus value. + */ + public Substatus subStatus() { + return this.subStatus; + } + + /** + * Set the subStatus property: The JIT status. + * + * @param subStatus the subStatus value to set. + * @return the UpdateAccessDefinitionInner object itself. + */ + public UpdateAccessDefinitionInner withSubStatus(Substatus subStatus) { + this.subStatus = subStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metadata in model UpdateAccessDefinitionInner")); + } else { + metadata().validate(); + } + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model UpdateAccessDefinitionInner")); + } + if (subStatus() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subStatus in model UpdateAccessDefinitionInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateAccessDefinitionInner.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/package-info.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/package-info.java new file mode 100644 index 000000000000..98a3578c7b6d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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 ManagedApplicationManagementClient. Managed Application Client. */ +package com.azure.resourcemanager.solutions.fluent.models; diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/package-info.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/package-info.java new file mode 100644 index 000000000000..6c149e5fd63f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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 ManagedApplicationManagementClient. Managed Application Client. */ +package com.azure.resourcemanager.solutions.fluent; diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/AllowedUpgradePlansResultImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/AllowedUpgradePlansResultImpl.java new file mode 100644 index 000000000000..a94788453a28 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/AllowedUpgradePlansResultImpl.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.solutions.implementation; + +import com.azure.resourcemanager.solutions.fluent.models.AllowedUpgradePlansResultInner; +import com.azure.resourcemanager.solutions.models.AllowedUpgradePlansResult; +import com.azure.resourcemanager.solutions.models.Plan; +import java.util.Collections; +import java.util.List; + +public final class AllowedUpgradePlansResultImpl implements AllowedUpgradePlansResult { + private AllowedUpgradePlansResultInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + AllowedUpgradePlansResultImpl( + AllowedUpgradePlansResultInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AllowedUpgradePlansResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionImpl.java new file mode 100644 index 000000000000..959860d0e6ce --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionImpl.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionArtifact; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionPatchable; +import com.azure.resourcemanager.solutions.models.ApplicationDeploymentPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import com.azure.resourcemanager.solutions.models.ApplicationManagementPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationNotificationPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationPackageLockingPolicyDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationPolicy; +import com.azure.resourcemanager.solutions.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicationDefinitionImpl + implements ApplicationDefinition, ApplicationDefinition.Definition, ApplicationDefinition.Update { + private ApplicationDefinitionInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager 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 String managedBy() { + return this.innerModel().managedBy(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ApplicationLockLevel lockLevel() { + return this.innerModel().lockLevel(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Boolean isEnabled() { + return this.innerModel().isEnabled(); + } + + public List authorizations() { + List inner = this.innerModel().authorizations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public String packageFileUri() { + return this.innerModel().packageFileUri(); + } + + public String storageAccountId() { + return this.innerModel().storageAccountId(); + } + + public Object mainTemplate() { + return this.innerModel().mainTemplate(); + } + + public Object createUiDefinition() { + return this.innerModel().createUiDefinition(); + } + + public ApplicationNotificationPolicy notificationPolicy() { + return this.innerModel().notificationPolicy(); + } + + public ApplicationPackageLockingPolicyDefinition lockingPolicy() { + return this.innerModel().lockingPolicy(); + } + + public ApplicationDeploymentPolicy deploymentPolicy() { + return this.innerModel().deploymentPolicy(); + } + + public ApplicationManagementPolicy managementPolicy() { + return this.innerModel().managementPolicy(); + } + + public List policies() { + List inner = this.innerModel().policies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApplicationDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String applicationDefinitionName; + + private ApplicationDefinitionPatchable updateParameters; + + public ApplicationDefinitionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApplicationDefinition create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationDefinitions() + .createOrUpdateWithResponse( + resourceGroupName, applicationDefinitionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ApplicationDefinition create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationDefinitions() + .createOrUpdateWithResponse(resourceGroupName, applicationDefinitionName, this.innerModel(), context) + .getValue(); + return this; + } + + ApplicationDefinitionImpl( + String name, com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = new ApplicationDefinitionInner(); + this.serviceManager = serviceManager; + this.applicationDefinitionName = name; + } + + public ApplicationDefinitionImpl update() { + this.updateParameters = new ApplicationDefinitionPatchable(); + return this; + } + + public ApplicationDefinition apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationDefinitions() + .updateWithResponse(resourceGroupName, applicationDefinitionName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ApplicationDefinition apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationDefinitions() + .updateWithResponse(resourceGroupName, applicationDefinitionName, updateParameters, context) + .getValue(); + return this; + } + + ApplicationDefinitionImpl( + ApplicationDefinitionInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationDefinitionName = Utils.getValueFromIdByName(innerObject.id(), "applicationDefinitions"); + } + + public ApplicationDefinition refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationDefinitions() + .getByResourceGroupWithResponse(resourceGroupName, applicationDefinitionName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationDefinition refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationDefinitions() + .getByResourceGroupWithResponse(resourceGroupName, applicationDefinitionName, context) + .getValue(); + return this; + } + + public ApplicationDefinitionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationDefinitionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationDefinitionImpl withLockLevel(ApplicationLockLevel lockLevel) { + this.innerModel().withLockLevel(lockLevel); + return this; + } + + public ApplicationDefinitionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApplicationDefinitionImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); + return this; + } + + public ApplicationDefinitionImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ApplicationDefinitionImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public ApplicationDefinitionImpl withIsEnabled(Boolean isEnabled) { + this.innerModel().withIsEnabled(isEnabled); + return this; + } + + public ApplicationDefinitionImpl withAuthorizations(List authorizations) { + this.innerModel().withAuthorizations(authorizations); + return this; + } + + public ApplicationDefinitionImpl withArtifacts(List artifacts) { + this.innerModel().withArtifacts(artifacts); + return this; + } + + public ApplicationDefinitionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public ApplicationDefinitionImpl withPackageFileUri(String packageFileUri) { + this.innerModel().withPackageFileUri(packageFileUri); + return this; + } + + public ApplicationDefinitionImpl withStorageAccountId(String storageAccountId) { + this.innerModel().withStorageAccountId(storageAccountId); + return this; + } + + public ApplicationDefinitionImpl withMainTemplate(Object mainTemplate) { + this.innerModel().withMainTemplate(mainTemplate); + return this; + } + + public ApplicationDefinitionImpl withCreateUiDefinition(Object createUiDefinition) { + this.innerModel().withCreateUiDefinition(createUiDefinition); + return this; + } + + public ApplicationDefinitionImpl withNotificationPolicy(ApplicationNotificationPolicy notificationPolicy) { + this.innerModel().withNotificationPolicy(notificationPolicy); + return this; + } + + public ApplicationDefinitionImpl withLockingPolicy(ApplicationPackageLockingPolicyDefinition lockingPolicy) { + this.innerModel().withLockingPolicy(lockingPolicy); + return this; + } + + public ApplicationDefinitionImpl withDeploymentPolicy(ApplicationDeploymentPolicy deploymentPolicy) { + this.innerModel().withDeploymentPolicy(deploymentPolicy); + return this; + } + + public ApplicationDefinitionImpl withManagementPolicy(ApplicationManagementPolicy managementPolicy) { + this.innerModel().withManagementPolicy(managementPolicy); + return this; + } + + public ApplicationDefinitionImpl withPolicies(List policies) { + this.innerModel().withPolicies(policies); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsClientImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsClientImpl.java new file mode 100644 index 000000000000..0fc93630c06f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsClientImpl.java @@ -0,0 +1,1988 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.ApplicationDefinitionsClient; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionListResult; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionPatchable; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationDefinitionsClient. */ +public final class ApplicationDefinitionsClientImpl implements ApplicationDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final ApplicationDefinitionsService service; + + /** The service client containing this operation class. */ + private final ManagedApplicationManagementClientImpl client; + + /** + * Initializes an instance of ApplicationDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationDefinitionsClientImpl(ManagedApplicationManagementClientImpl client) { + this.service = + RestProxy + .create(ApplicationDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ManagedApplicationManagementClientApplicationDefinitions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ManagedApplicationMa") + private interface ApplicationDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @BodyParam("application/json") ApplicationDefinitionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @BodyParam("application/json") ApplicationDefinitionPatchable parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions") + @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.Solutions/applicationDefinitions") + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteById( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateById( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationDefinitionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applicationDefinitions/{applicationDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationDefinitionName") String applicationDefinitionName, + @BodyParam("application/json") ApplicationDefinitionPatchable parameters, + @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); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationDefinitionName) { + 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationDefinitionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationDefinitionName, + accept, + context); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String applicationDefinitionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationDefinitionInner getByResourceGroup(String resourceGroupName, String applicationDefinitionName) { + return getByResourceGroupAsync(resourceGroupName, applicationDefinitionName).block(); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationDefinitionName, context).block(); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 applicationDefinitionName) { + 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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(), + applicationDefinitionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 applicationDefinitionName, 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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(), + applicationDefinitionName, + accept, + context); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 applicationDefinitionName) { + return deleteWithResponseAsync(resourceGroupName, applicationDefinitionName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 applicationDefinitionName) { + deleteAsync(resourceGroupName, applicationDefinitionName).block(); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 applicationDefinitionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, applicationDefinitionName, context).block(); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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(), + applicationDefinitionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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(), + applicationDefinitionName, + parameters, + accept, + context); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationDefinitionInner createOrUpdate( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters) { + return createOrUpdateAsync(resourceGroupName, applicationDefinitionName, parameters).block(); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update an managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters, context) + .block(); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationDefinitionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationDefinitionName, + parameters, + accept, + context); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters) { + return updateWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationDefinitionInner update( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters) { + return updateAsync(resourceGroupName, applicationDefinitionName, parameters).block(); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters, context).block(); + } + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions 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())); + } + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions 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)); + } + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions 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)); + } + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the application definitions 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 list of managed application definitions 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())); + } + + /** + * Lists all the application definitions 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 list of managed application definitions 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)); + } + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String resourceGroupName, String applicationDefinitionName) { + 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 + .getById( + this.client.getEndpoint(), + resourceGroupName, + applicationDefinitionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 + .getById( + this.client.getEndpoint(), + resourceGroupName, + applicationDefinitionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String resourceGroupName, String applicationDefinitionName) { + return getByIdWithResponseAsync(resourceGroupName, applicationDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationDefinitionInner getById(String resourceGroupName, String applicationDefinitionName) { + return getByIdAsync(resourceGroupName, applicationDefinitionName).block(); + } + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return getByIdWithResponseAsync(resourceGroupName, applicationDefinitionName, context).block(); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> deleteByIdWithResponseAsync( + String resourceGroupName, String applicationDefinitionName) { + 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 + .deleteById( + this.client.getEndpoint(), + resourceGroupName, + applicationDefinitionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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> deleteByIdWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 + .deleteById( + this.client.getEndpoint(), + resourceGroupName, + applicationDefinitionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteByIdAsync(String resourceGroupName, String applicationDefinitionName) { + return deleteByIdWithResponseAsync(resourceGroupName, applicationDefinitionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteById(String resourceGroupName, String applicationDefinitionName) { + deleteByIdAsync(resourceGroupName, applicationDefinitionName).block(); + } + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 deleteByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return deleteByIdWithResponseAsync(resourceGroupName, applicationDefinitionName, context).block(); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByIdWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 (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 + .createOrUpdateById( + this.client.getEndpoint(), + resourceGroupName, + applicationDefinitionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByIdWithResponseAsync( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 (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 + .createOrUpdateById( + this.client.getEndpoint(), + resourceGroupName, + applicationDefinitionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters) { + return createOrUpdateByIdWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationDefinitionInner createOrUpdateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters) { + return createOrUpdateByIdAsync(resourceGroupName, applicationDefinitionName, parameters).block(); + } + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + Context context) { + return createOrUpdateByIdWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters, context) + .block(); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateByIdWithResponseAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 + .updateById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationDefinitionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateByIdWithResponseAsync( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable 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 (applicationDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationDefinitionName 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 + .updateById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationDefinitionName, + parameters, + accept, + context); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateByIdAsync( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters) { + return updateByIdWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationDefinitionInner updateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters) { + return updateByIdAsync(resourceGroupName, applicationDefinitionName, parameters).block(); + } + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable parameters, + Context context) { + return updateByIdWithResponseAsync(resourceGroupName, applicationDefinitionName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list of managed application definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list of managed application definitions 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 URL to get the next list of items + *

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 list of managed application definitions 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 URL to get the next list of items + *

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 list of managed application definitions 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsImpl.java new file mode 100644 index 000000000000..49746f1b45c1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.ApplicationDefinitionsClient; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionPatchable; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitions; + +public final class ApplicationDefinitionsImpl implements ApplicationDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationDefinitionsImpl.class); + + private final ApplicationDefinitionsClient innerClient; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + public ApplicationDefinitionsImpl( + ApplicationDefinitionsClient innerClient, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ApplicationDefinition getByResourceGroup(String resourceGroupName, String applicationDefinitionName) { + ApplicationDefinitionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, applicationDefinitionName); + if (inner != null) { + return new ApplicationDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationDefinitionName) { + this.serviceClient().delete(resourceGroupName, applicationDefinitionName); + } + + public Response deleteWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, applicationDefinitionName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationDefinitionImpl(inner1, this.manager())); + } + + public ApplicationDefinition getById(String resourceGroupName, String applicationDefinitionName) { + ApplicationDefinitionInner inner = this.serviceClient().getById(resourceGroupName, applicationDefinitionName); + if (inner != null) { + return new ApplicationDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(resourceGroupName, applicationDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteById(String resourceGroupName, String applicationDefinitionName) { + this.serviceClient().deleteById(resourceGroupName, applicationDefinitionName); + } + + public Response deleteByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return this.serviceClient().deleteByIdWithResponse(resourceGroupName, applicationDefinitionName, context); + } + + public ApplicationDefinition createOrUpdateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters) { + ApplicationDefinitionInner inner = + this.serviceClient().createOrUpdateById(resourceGroupName, applicationDefinitionName, parameters); + if (inner != null) { + return new ApplicationDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateByIdWithResponse(resourceGroupName, applicationDefinitionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationDefinition updateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters) { + ApplicationDefinitionInner inner = + this.serviceClient().updateById(resourceGroupName, applicationDefinitionName, parameters); + if (inner != null) { + return new ApplicationDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateByIdWithResponse(resourceGroupName, applicationDefinitionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ApplicationDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } + + public ApplicationDefinitionImpl define(String name) { + return new ApplicationDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationImpl.java new file mode 100644 index 000000000000..e3a95a72796f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationImpl.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.AllowedUpgradePlansResult; +import com.azure.resourcemanager.solutions.models.Application; +import com.azure.resourcemanager.solutions.models.ApplicationArtifact; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationBillingDetailsDefinition; +import com.azure.resourcemanager.solutions.models.ApplicationClientDetails; +import com.azure.resourcemanager.solutions.models.ApplicationJitAccessPolicy; +import com.azure.resourcemanager.solutions.models.ApplicationManagementMode; +import com.azure.resourcemanager.solutions.models.ApplicationPackageContact; +import com.azure.resourcemanager.solutions.models.ApplicationPackageSupportUrls; +import com.azure.resourcemanager.solutions.models.ApplicationPatchable; +import com.azure.resourcemanager.solutions.models.Identity; +import com.azure.resourcemanager.solutions.models.ListTokenRequest; +import com.azure.resourcemanager.solutions.models.ManagedIdentityTokenResult; +import com.azure.resourcemanager.solutions.models.Plan; +import com.azure.resourcemanager.solutions.models.PlanPatchable; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import com.azure.resourcemanager.solutions.models.Sku; +import com.azure.resourcemanager.solutions.models.UpdateAccessDefinition; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicationImpl implements Application, Application.Definition, Application.Update { + private ApplicationInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager 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 String managedBy() { + return this.innerModel().managedBy(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public String managedResourceGroupId() { + return this.innerModel().managedResourceGroupId(); + } + + public String applicationDefinitionId() { + return this.innerModel().applicationDefinitionId(); + } + + public Object parameters() { + return this.innerModel().parameters(); + } + + public Object outputs() { + return this.innerModel().outputs(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ApplicationBillingDetailsDefinition billingDetails() { + return this.innerModel().billingDetails(); + } + + public ApplicationJitAccessPolicy jitAccessPolicy() { + return this.innerModel().jitAccessPolicy(); + } + + public String publisherTenantId() { + return this.innerModel().publisherTenantId(); + } + + public List authorizations() { + List inner = this.innerModel().authorizations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationManagementMode managementMode() { + return this.innerModel().managementMode(); + } + + public ApplicationPackageContact customerSupport() { + return this.innerModel().customerSupport(); + } + + public ApplicationPackageSupportUrls supportUrls() { + return this.innerModel().supportUrls(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationClientDetails createdBy() { + return this.innerModel().createdBy(); + } + + public ApplicationClientDetails updatedBy() { + return this.innerModel().updatedBy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String applicationName; + + private ApplicationPatchable updateParameters; + + public ApplicationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Application create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createOrUpdate(resourceGroupName, applicationName, this.innerModel(), Context.NONE); + return this; + } + + public Application create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createOrUpdate(resourceGroupName, applicationName, this.innerModel(), context); + return this; + } + + ApplicationImpl(String name, com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = new ApplicationInner(); + this.serviceManager = serviceManager; + this.applicationName = name; + } + + public ApplicationImpl update() { + this.updateParameters = new ApplicationPatchable(); + return this; + } + + public Application apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .update(resourceGroupName, applicationName, updateParameters, Context.NONE); + return this; + } + + public Application apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .update(resourceGroupName, applicationName, updateParameters, context); + return this; + } + + ApplicationImpl( + ApplicationInner innerObject, com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + } + + public Application refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getByResourceGroupWithResponse(resourceGroupName, applicationName, Context.NONE) + .getValue(); + return this; + } + + public Application refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getByResourceGroupWithResponse(resourceGroupName, applicationName, context) + .getValue(); + return this; + } + + public void refreshPermissions() { + serviceManager.applications().refreshPermissions(resourceGroupName, applicationName); + } + + public void refreshPermissions(Context context) { + serviceManager.applications().refreshPermissions(resourceGroupName, applicationName, context); + } + + public AllowedUpgradePlansResult listAllowedUpgradePlans() { + return serviceManager.applications().listAllowedUpgradePlans(resourceGroupName, applicationName); + } + + public Response listAllowedUpgradePlansWithResponse(Context context) { + return serviceManager + .applications() + .listAllowedUpgradePlansWithResponse(resourceGroupName, applicationName, context); + } + + public UpdateAccessDefinition updateAccess(UpdateAccessDefinitionInner parameters) { + return serviceManager.applications().updateAccess(resourceGroupName, applicationName, parameters); + } + + public UpdateAccessDefinition updateAccess(UpdateAccessDefinitionInner parameters, Context context) { + return serviceManager.applications().updateAccess(resourceGroupName, applicationName, parameters, context); + } + + public ManagedIdentityTokenResult listTokens(ListTokenRequest parameters) { + return serviceManager.applications().listTokens(resourceGroupName, applicationName, parameters); + } + + public Response listTokensWithResponse(ListTokenRequest parameters, Context context) { + return serviceManager + .applications() + .listTokensWithResponse(resourceGroupName, applicationName, parameters, context); + } + + public ApplicationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationImpl withKind(String kind) { + if (isInCreateMode()) { + this.innerModel().withKind(kind); + return this; + } else { + this.updateParameters.withKind(kind); + return this; + } + } + + public ApplicationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApplicationImpl withManagedBy(String managedBy) { + if (isInCreateMode()) { + this.innerModel().withManagedBy(managedBy); + return this; + } else { + this.updateParameters.withManagedBy(managedBy); + return this; + } + } + + public ApplicationImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public ApplicationImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); + return this; + } + + public ApplicationImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public ApplicationImpl withManagedResourceGroupId(String managedResourceGroupId) { + if (isInCreateMode()) { + this.innerModel().withManagedResourceGroupId(managedResourceGroupId); + return this; + } else { + this.updateParameters.withManagedResourceGroupId(managedResourceGroupId); + return this; + } + } + + public ApplicationImpl withApplicationDefinitionId(String applicationDefinitionId) { + if (isInCreateMode()) { + this.innerModel().withApplicationDefinitionId(applicationDefinitionId); + return this; + } else { + this.updateParameters.withApplicationDefinitionId(applicationDefinitionId); + return this; + } + } + + public ApplicationImpl withParameters(Object parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateParameters.withParameters(parameters); + return this; + } + } + + public ApplicationImpl withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy) { + if (isInCreateMode()) { + this.innerModel().withJitAccessPolicy(jitAccessPolicy); + return this; + } else { + this.updateParameters.withJitAccessPolicy(jitAccessPolicy); + return this; + } + } + + public ApplicationImpl withPlan(PlanPatchable plan) { + this.updateParameters.withPlan(plan); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsClientImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsClientImpl.java new file mode 100644 index 000000000000..35c44f17369b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsClientImpl.java @@ -0,0 +1,3332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.Post; +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.solutions.fluent.ApplicationsClient; +import com.azure.resourcemanager.solutions.fluent.models.AllowedUpgradePlansResultInner; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationListResult; +import com.azure.resourcemanager.solutions.models.ApplicationPatchable; +import com.azure.resourcemanager.solutions.models.ListTokenRequest; +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 ApplicationsClient. */ +public final class ApplicationsClientImpl implements ApplicationsClient { + /** The proxy service used to perform REST calls. */ + private final ApplicationsService service; + + /** The service client containing this operation class. */ + private final ManagedApplicationManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationsClientImpl(ManagedApplicationManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ManagedApplicationManagementClientApplications to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ManagedApplicationMa") + private interface ApplicationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationName") String applicationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}") + @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("applicationName") String applicationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationName") String applicationName, + @BodyParam("application/json") ApplicationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationName") String applicationName, + @BodyParam("application/json") ApplicationPatchable parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications") + @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.Solutions/applications") + @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("/{applicationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam(value = "applicationId", encoded = true) String applicationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{applicationId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteById( + @HostParam("$host") String endpoint, + @PathParam(value = "applicationId", encoded = true) String applicationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{applicationId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateById( + @HostParam("$host") String endpoint, + @PathParam(value = "applicationId", encoded = true) String applicationId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ApplicationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{applicationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateById( + @HostParam("$host") String endpoint, + @PathParam(value = "applicationId", encoded = true) String applicationId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ApplicationPatchable parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}/refreshPermissions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshPermissions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationName") String applicationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}/listAllowedUpgradePlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllowedUpgradePlans( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("applicationName") String applicationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}/updateAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationName") String applicationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateAccessDefinitionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/applications/{applicationName}/listTokens") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTokens( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationName") String applicationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ListTokenRequest parameters, + @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); + } + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationName) { + 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String applicationName, 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + accept, + context); + } + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String applicationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner getByResourceGroup(String resourceGroupName, String applicationName) { + return getByResourceGroupAsync(resourceGroupName, applicationName).block(); + } + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationName, context).block(); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 applicationName) { + 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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(), + applicationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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(), + applicationName, + accept, + context); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 applicationName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, applicationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, applicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 applicationName) { + return beginDeleteAsync(resourceGroupName, applicationName).getSyncPoller(); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationName, context).getSyncPoller(); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 applicationName) { + return beginDeleteAsync(resourceGroupName, applicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 applicationName) { + deleteAsync(resourceGroupName, applicationName).block(); + } + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context) { + deleteAsync(resourceGroupName, applicationName, context).block(); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String applicationName, ApplicationInner 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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(), + applicationName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String applicationName, ApplicationInner 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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(), + applicationName, + parameters, + accept, + context); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String applicationName, ApplicationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, applicationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationInner.class, + ApplicationInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String applicationName, ApplicationInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationInner.class, ApplicationInner.class, context); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginCreateOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginCreateOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String applicationName, ApplicationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String applicationName, ApplicationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner createOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters) { + return createOrUpdateAsync(resourceGroupName, applicationName, parameters).block(); + } + + /** + * Creates or updates a managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner createOrUpdate( + String resourceGroupName, String applicationName, ApplicationInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, applicationName, parameters, context).block(); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String applicationName, ApplicationPatchable 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String applicationName, ApplicationPatchable 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + parameters, + accept, + context); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginUpdateAsync( + String resourceGroupName, String applicationName, ApplicationPatchable parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, applicationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationInner.class, + ApplicationInner.class, + this.client.getContext()); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginUpdateAsync( + String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationInner.class, ApplicationInner.class, context); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginUpdate( + String resourceGroupName, String applicationName, ApplicationPatchable parameters) { + return beginUpdateAsync(resourceGroupName, applicationName, parameters).getSyncPoller(); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginUpdate( + String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context) { + return beginUpdateAsync(resourceGroupName, applicationName, parameters, context).getSyncPoller(); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String applicationName, ApplicationPatchable parameters) { + return beginUpdateAsync(resourceGroupName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String applicationName) { + final ApplicationPatchable parameters = null; + return beginUpdateAsync(resourceGroupName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context) { + return beginUpdateAsync(resourceGroupName, applicationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner update(String resourceGroupName, String applicationName, ApplicationPatchable parameters) { + return updateAsync(resourceGroupName, applicationName, parameters).block(); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner update(String resourceGroupName, String applicationName) { + final ApplicationPatchable parameters = null; + return updateAsync(resourceGroupName, applicationName, parameters).block(); + } + + /** + * Updates an existing managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner update( + String resourceGroupName, String applicationName, ApplicationPatchable parameters, Context context) { + return updateAsync(resourceGroupName, applicationName, parameters, context).block(); + } + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications 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())); + } + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications 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)); + } + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications 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)); + } + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the applications 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 list of managed applications 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())); + } + + /** + * Lists all the applications 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 list of managed applications 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)); + } + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String applicationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), applicationId, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String applicationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), applicationId, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String applicationId) { + return getByIdWithResponseAsync(applicationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner getById(String applicationId) { + return getByIdAsync(applicationId).block(); + } + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse(String applicationId, Context context) { + return getByIdWithResponseAsync(applicationId, context).block(); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteByIdWithResponseAsync(String applicationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), applicationId, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteByIdWithResponseAsync(String applicationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById(this.client.getEndpoint(), applicationId, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteByIdAsync(String applicationId) { + Mono>> mono = deleteByIdWithResponseAsync(applicationId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteByIdAsync(String applicationId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteByIdWithResponseAsync(applicationId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteById(String applicationId) { + return beginDeleteByIdAsync(applicationId).getSyncPoller(); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteById(String applicationId, Context context) { + return beginDeleteByIdAsync(applicationId, context).getSyncPoller(); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String applicationId) { + return beginDeleteByIdAsync(applicationId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String applicationId, Context context) { + return beginDeleteByIdAsync(applicationId, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteById(String applicationId) { + deleteByIdAsync(applicationId).block(); + } + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteById(String applicationId, Context context) { + deleteByIdAsync(applicationId, context).block(); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateByIdWithResponseAsync( + String applicationId, ApplicationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId 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 + .createOrUpdateById( + this.client.getEndpoint(), + applicationId, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateByIdWithResponseAsync( + String applicationId, ApplicationInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId 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 + .createOrUpdateById( + this.client.getEndpoint(), applicationId, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginCreateOrUpdateByIdAsync( + String applicationId, ApplicationInner parameters) { + Mono>> mono = createOrUpdateByIdWithResponseAsync(applicationId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationInner.class, + ApplicationInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginCreateOrUpdateByIdAsync( + String applicationId, ApplicationInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateByIdWithResponseAsync(applicationId, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationInner.class, ApplicationInner.class, context); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginCreateOrUpdateById( + String applicationId, ApplicationInner parameters) { + return beginCreateOrUpdateByIdAsync(applicationId, parameters).getSyncPoller(); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginCreateOrUpdateById( + String applicationId, ApplicationInner parameters, Context context) { + return beginCreateOrUpdateByIdAsync(applicationId, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync(String applicationId, ApplicationInner parameters) { + return beginCreateOrUpdateByIdAsync(applicationId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync( + String applicationId, ApplicationInner parameters, Context context) { + return beginCreateOrUpdateByIdAsync(applicationId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner createOrUpdateById(String applicationId, ApplicationInner parameters) { + return createOrUpdateByIdAsync(applicationId, parameters).block(); + } + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner createOrUpdateById(String applicationId, ApplicationInner parameters, Context context) { + return createOrUpdateByIdAsync(applicationId, parameters, context).block(); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateByIdWithResponseAsync( + String applicationId, ApplicationPatchable parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateById( + this.client.getEndpoint(), + applicationId, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateByIdWithResponseAsync( + String applicationId, ApplicationPatchable parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (applicationId == null) { + return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateById( + this.client.getEndpoint(), applicationId, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginUpdateByIdAsync( + String applicationId, ApplicationPatchable parameters) { + Mono>> mono = updateByIdWithResponseAsync(applicationId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationInner.class, + ApplicationInner.class, + this.client.getContext()); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationInner> beginUpdateByIdAsync( + String applicationId, ApplicationPatchable parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateByIdWithResponseAsync(applicationId, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationInner.class, ApplicationInner.class, context); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginUpdateById( + String applicationId, ApplicationPatchable parameters) { + return beginUpdateByIdAsync(applicationId, parameters).getSyncPoller(); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationInner> beginUpdateById( + String applicationId, ApplicationPatchable parameters, Context context) { + return beginUpdateByIdAsync(applicationId, parameters, context).getSyncPoller(); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateByIdAsync(String applicationId, ApplicationPatchable parameters) { + return beginUpdateByIdAsync(applicationId, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateByIdAsync(String applicationId) { + final ApplicationPatchable parameters = null; + return beginUpdateByIdAsync(applicationId, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateByIdAsync( + String applicationId, ApplicationPatchable parameters, Context context) { + return beginUpdateByIdAsync(applicationId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner updateById(String applicationId, ApplicationPatchable parameters) { + return updateByIdAsync(applicationId, parameters).block(); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner updateById(String applicationId) { + final ApplicationPatchable parameters = null; + return updateByIdAsync(applicationId, parameters).block(); + } + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner updateById(String applicationId, ApplicationPatchable parameters, Context context) { + return updateByIdAsync(applicationId, parameters, context).block(); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> refreshPermissionsWithResponseAsync( + String resourceGroupName, String applicationName) { + 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refreshPermissions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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>> refreshPermissionsWithResponseAsync( + String resourceGroupName, String applicationName, 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refreshPermissions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + accept, + context); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginRefreshPermissionsAsync( + String resourceGroupName, String applicationName) { + Mono>> mono = refreshPermissionsWithResponseAsync(resourceGroupName, applicationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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> beginRefreshPermissionsAsync( + String resourceGroupName, String applicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + refreshPermissionsWithResponseAsync(resourceGroupName, applicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginRefreshPermissions( + String resourceGroupName, String applicationName) { + return beginRefreshPermissionsAsync(resourceGroupName, applicationName).getSyncPoller(); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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> beginRefreshPermissions( + String resourceGroupName, String applicationName, Context context) { + return beginRefreshPermissionsAsync(resourceGroupName, applicationName, context).getSyncPoller(); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 refreshPermissionsAsync(String resourceGroupName, String applicationName) { + return beginRefreshPermissionsAsync(resourceGroupName, applicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 refreshPermissionsAsync(String resourceGroupName, String applicationName, Context context) { + return beginRefreshPermissionsAsync(resourceGroupName, applicationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refreshPermissions(String resourceGroupName, String applicationName) { + refreshPermissionsAsync(resourceGroupName, applicationName).block(); + } + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 refreshPermissions(String resourceGroupName, String applicationName, Context context) { + refreshPermissionsAsync(resourceGroupName, applicationName, context).block(); + } + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 array of plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllowedUpgradePlansWithResponseAsync( + String resourceGroupName, String applicationName) { + 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAllowedUpgradePlans( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 array of plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllowedUpgradePlansWithResponseAsync( + String resourceGroupName, String applicationName, 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAllowedUpgradePlans( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + applicationName, + accept, + context); + } + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 array of plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAllowedUpgradePlansAsync( + String resourceGroupName, String applicationName) { + return listAllowedUpgradePlansWithResponseAsync(resourceGroupName, applicationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 array of plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AllowedUpgradePlansResultInner listAllowedUpgradePlans(String resourceGroupName, String applicationName) { + return listAllowedUpgradePlansAsync(resourceGroupName, applicationName).block(); + } + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 array of plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAllowedUpgradePlansWithResponse( + String resourceGroupName, String applicationName, Context context) { + return listAllowedUpgradePlansWithResponseAsync(resourceGroupName, applicationName, context).block(); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAccessWithResponseAsync( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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 + .updateAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + applicationName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAccessWithResponseAsync( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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 + .updateAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + applicationName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, UpdateAccessDefinitionInner> beginUpdateAccessAsync( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters) { + Mono>> mono = + updateAccessWithResponseAsync(resourceGroupName, applicationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + UpdateAccessDefinitionInner.class, + UpdateAccessDefinitionInner.class, + this.client.getContext()); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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, UpdateAccessDefinitionInner> beginUpdateAccessAsync( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAccessWithResponseAsync(resourceGroupName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + UpdateAccessDefinitionInner.class, + UpdateAccessDefinitionInner.class, + context); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, UpdateAccessDefinitionInner> beginUpdateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters) { + return beginUpdateAccessAsync(resourceGroupName, applicationName, parameters).getSyncPoller(); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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, UpdateAccessDefinitionInner> beginUpdateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context) { + return beginUpdateAccessAsync(resourceGroupName, applicationName, parameters, context).getSyncPoller(); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAccessAsync( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters) { + return beginUpdateAccessAsync(resourceGroupName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAccessAsync( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context) { + return beginUpdateAccessAsync(resourceGroupName, applicationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateAccessDefinitionInner updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters) { + return updateAccessAsync(resourceGroupName, applicationName, parameters).block(); + } + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateAccessDefinitionInner updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context) { + return updateAccessAsync(resourceGroupName, applicationName, parameters, context).block(); + } + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 array of managed identity tokens along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTokensWithResponseAsync( + String resourceGroupName, String applicationName, ListTokenRequest 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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 + .listTokens( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + applicationName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTokensWithResponseAsync( + String resourceGroupName, String applicationName, ListTokenRequest 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 (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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 + .listTokens( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + applicationName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 array of managed identity tokens on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listTokensAsync( + String resourceGroupName, String applicationName, ListTokenRequest parameters) { + return listTokensWithResponseAsync(resourceGroupName, applicationName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 array of managed identity tokens. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedIdentityTokenResultInner listTokens( + String resourceGroupName, String applicationName, ListTokenRequest parameters) { + return listTokensAsync(resourceGroupName, applicationName, parameters).block(); + } + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listTokensWithResponse( + String resourceGroupName, String applicationName, ListTokenRequest parameters, Context context) { + return listTokensWithResponseAsync(resourceGroupName, applicationName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list of managed applications along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list of managed applications 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 URL to get the next list of items + *

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 list of managed applications 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 URL to get the next list of items + *

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 list of managed applications 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsImpl.java new file mode 100644 index 000000000000..5008e6f145db --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsImpl.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.ApplicationsClient; +import com.azure.resourcemanager.solutions.fluent.models.AllowedUpgradePlansResultInner; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.AllowedUpgradePlansResult; +import com.azure.resourcemanager.solutions.models.Application; +import com.azure.resourcemanager.solutions.models.ApplicationPatchable; +import com.azure.resourcemanager.solutions.models.Applications; +import com.azure.resourcemanager.solutions.models.ListTokenRequest; +import com.azure.resourcemanager.solutions.models.ManagedIdentityTokenResult; +import com.azure.resourcemanager.solutions.models.UpdateAccessDefinition; + +public final class ApplicationsImpl implements Applications { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationsImpl.class); + + private final ApplicationsClient innerClient; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + public ApplicationsImpl( + ApplicationsClient innerClient, com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Application getByResourceGroup(String resourceGroupName, String applicationName) { + ApplicationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, applicationName); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationName) { + this.serviceClient().delete(resourceGroupName, applicationName); + } + + public void delete(String resourceGroupName, String applicationName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public Application getById(String applicationId) { + ApplicationInner inner = this.serviceClient().getById(applicationId); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String applicationId, Context context) { + Response inner = this.serviceClient().getByIdWithResponse(applicationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteById(String applicationId) { + this.serviceClient().deleteById(applicationId); + } + + public void deleteById(String applicationId, Context context) { + this.serviceClient().deleteById(applicationId, context); + } + + public Application createOrUpdateById(String applicationId, ApplicationInner parameters) { + ApplicationInner inner = this.serviceClient().createOrUpdateById(applicationId, parameters); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Application createOrUpdateById(String applicationId, ApplicationInner parameters, Context context) { + ApplicationInner inner = this.serviceClient().createOrUpdateById(applicationId, parameters, context); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Application updateById(String applicationId, ApplicationPatchable parameters) { + ApplicationInner inner = this.serviceClient().updateById(applicationId, parameters); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Application updateById(String applicationId) { + ApplicationInner inner = this.serviceClient().updateById(applicationId); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Application updateById(String applicationId, ApplicationPatchable parameters, Context context) { + ApplicationInner inner = this.serviceClient().updateById(applicationId, parameters, context); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void refreshPermissions(String resourceGroupName, String applicationName) { + this.serviceClient().refreshPermissions(resourceGroupName, applicationName); + } + + public void refreshPermissions(String resourceGroupName, String applicationName, Context context) { + this.serviceClient().refreshPermissions(resourceGroupName, applicationName, context); + } + + public AllowedUpgradePlansResult listAllowedUpgradePlans(String resourceGroupName, String applicationName) { + AllowedUpgradePlansResultInner inner = + this.serviceClient().listAllowedUpgradePlans(resourceGroupName, applicationName); + if (inner != null) { + return new AllowedUpgradePlansResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAllowedUpgradePlansWithResponse( + String resourceGroupName, String applicationName, Context context) { + Response inner = + this.serviceClient().listAllowedUpgradePlansWithResponse(resourceGroupName, applicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AllowedUpgradePlansResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateAccessDefinition updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters) { + UpdateAccessDefinitionInner inner = + this.serviceClient().updateAccess(resourceGroupName, applicationName, parameters); + if (inner != null) { + return new UpdateAccessDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateAccessDefinition updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context) { + UpdateAccessDefinitionInner inner = + this.serviceClient().updateAccess(resourceGroupName, applicationName, parameters, context); + if (inner != null) { + return new UpdateAccessDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedIdentityTokenResult listTokens( + String resourceGroupName, String applicationName, ListTokenRequest parameters) { + ManagedIdentityTokenResultInner inner = + this.serviceClient().listTokens(resourceGroupName, applicationName, parameters); + if (inner != null) { + return new ManagedIdentityTokenResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listTokensWithResponse( + String resourceGroupName, String applicationName, ListTokenRequest parameters, Context context) { + Response inner = + this.serviceClient().listTokensWithResponse(resourceGroupName, applicationName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedIdentityTokenResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ApplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } + + public ApplicationImpl define(String name) { + return new ApplicationImpl(name, this.manager()); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestDefinitionImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestDefinitionImpl.java new file mode 100644 index 000000000000..a9b7e74c3b87 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestDefinitionImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationClientDetails; +import com.azure.resourcemanager.solutions.models.JitAuthorizationPolicies; +import com.azure.resourcemanager.solutions.models.JitRequestDefinition; +import com.azure.resourcemanager.solutions.models.JitRequestPatchable; +import com.azure.resourcemanager.solutions.models.JitRequestState; +import com.azure.resourcemanager.solutions.models.JitSchedulingPolicy; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class JitRequestDefinitionImpl + implements JitRequestDefinition, JitRequestDefinition.Definition, JitRequestDefinition.Update { + private JitRequestDefinitionInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager 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 applicationResourceId() { + return this.innerModel().applicationResourceId(); + } + + public String publisherTenantId() { + return this.innerModel().publisherTenantId(); + } + + public List jitAuthorizationPolicies() { + List inner = this.innerModel().jitAuthorizationPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public JitSchedulingPolicy jitSchedulingPolicy() { + return this.innerModel().jitSchedulingPolicy(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public JitRequestState jitRequestState() { + return this.innerModel().jitRequestState(); + } + + public ApplicationClientDetails createdBy() { + return this.innerModel().createdBy(); + } + + public ApplicationClientDetails updatedBy() { + return this.innerModel().updatedBy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public JitRequestDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String jitRequestName; + + private JitRequestPatchable updateParameters; + + public JitRequestDefinitionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public JitRequestDefinition create() { + this.innerObject = + serviceManager + .serviceClient() + .getJitRequests() + .createOrUpdate(resourceGroupName, jitRequestName, this.innerModel(), Context.NONE); + return this; + } + + public JitRequestDefinition create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJitRequests() + .createOrUpdate(resourceGroupName, jitRequestName, this.innerModel(), context); + return this; + } + + JitRequestDefinitionImpl( + String name, com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = new JitRequestDefinitionInner(); + this.serviceManager = serviceManager; + this.jitRequestName = name; + } + + public JitRequestDefinitionImpl update() { + this.updateParameters = new JitRequestPatchable(); + return this; + } + + public JitRequestDefinition apply() { + this.innerObject = + serviceManager + .serviceClient() + .getJitRequests() + .updateWithResponse(resourceGroupName, jitRequestName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public JitRequestDefinition apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJitRequests() + .updateWithResponse(resourceGroupName, jitRequestName, updateParameters, context) + .getValue(); + return this; + } + + JitRequestDefinitionImpl( + JitRequestDefinitionInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.jitRequestName = Utils.getValueFromIdByName(innerObject.id(), "jitRequests"); + } + + public JitRequestDefinition refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getJitRequests() + .getByResourceGroupWithResponse(resourceGroupName, jitRequestName, Context.NONE) + .getValue(); + return this; + } + + public JitRequestDefinition refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJitRequests() + .getByResourceGroupWithResponse(resourceGroupName, jitRequestName, context) + .getValue(); + return this; + } + + public JitRequestDefinitionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public JitRequestDefinitionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public JitRequestDefinitionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public JitRequestDefinitionImpl withApplicationResourceId(String applicationResourceId) { + this.innerModel().withApplicationResourceId(applicationResourceId); + return this; + } + + public JitRequestDefinitionImpl withJitAuthorizationPolicies( + List jitAuthorizationPolicies) { + this.innerModel().withJitAuthorizationPolicies(jitAuthorizationPolicies); + return this; + } + + public JitRequestDefinitionImpl withJitSchedulingPolicy(JitSchedulingPolicy jitSchedulingPolicy) { + this.innerModel().withJitSchedulingPolicy(jitSchedulingPolicy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestDefinitionListResultImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestDefinitionListResultImpl.java new file mode 100644 index 000000000000..61b67333d558 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestDefinitionListResultImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionInner; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionListResultInner; +import com.azure.resourcemanager.solutions.models.JitRequestDefinition; +import com.azure.resourcemanager.solutions.models.JitRequestDefinitionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class JitRequestDefinitionListResultImpl implements JitRequestDefinitionListResult { + private JitRequestDefinitionListResultInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + JitRequestDefinitionListResultImpl( + JitRequestDefinitionListResultInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new JitRequestDefinitionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public JitRequestDefinitionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsClientImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsClientImpl.java new file mode 100644 index 000000000000..24149f91e8f7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsClientImpl.java @@ -0,0 +1,1103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.solutions.fluent.JitRequestsClient; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionInner; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionListResultInner; +import com.azure.resourcemanager.solutions.models.JitRequestPatchable; +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 JitRequestsClient. */ +public final class JitRequestsClientImpl implements JitRequestsClient { + /** The proxy service used to perform REST calls. */ + private final JitRequestsService service; + + /** The service client containing this operation class. */ + private final ManagedApplicationManagementClientImpl client; + + /** + * Initializes an instance of JitRequestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JitRequestsClientImpl(ManagedApplicationManagementClientImpl client) { + this.service = + RestProxy.create(JitRequestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ManagedApplicationManagementClientJitRequests to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ManagedApplicationMa") + private interface JitRequestsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/jitRequests/{jitRequestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jitRequestName") String jitRequestName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/jitRequests/{jitRequestName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jitRequestName") String jitRequestName, + @BodyParam("application/json") JitRequestDefinitionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/jitRequests/{jitRequestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jitRequestName") String jitRequestName, + @BodyParam("application/json") JitRequestPatchable parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/jitRequests/{jitRequestName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jitRequestName") String jitRequestName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Solutions/jitRequests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions" + + "/jitRequests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String jitRequestName) { + 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jitRequestName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 JIT request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String jitRequestName, 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jitRequestName, + accept, + context); + } + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String jitRequestName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, jitRequestName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JitRequestDefinitionInner getByResourceGroup(String resourceGroupName, String jitRequestName) { + return getByResourceGroupAsync(resourceGroupName, jitRequestName).block(); + } + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 JIT request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String jitRequestName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, jitRequestName, context).block(); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName 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(), + jitRequestName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName 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(), + jitRequestName, + parameters, + accept, + context); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about JIT request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JitRequestDefinitionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, jitRequestName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + JitRequestDefinitionInner.class, + JitRequestDefinitionInner.class, + this.client.getContext()); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 information about JIT request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JitRequestDefinitionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, jitRequestName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + JitRequestDefinitionInner.class, + JitRequestDefinitionInner.class, + context); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 information about JIT request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JitRequestDefinitionInner> beginCreateOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, jitRequestName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 information about JIT request definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JitRequestDefinitionInner> beginCreateOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, jitRequestName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, jitRequestName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, jitRequestName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JitRequestDefinitionInner createOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters) { + return createOrUpdateAsync(resourceGroupName, jitRequestName, parameters).block(); + } + + /** + * Creates or updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JitRequestDefinitionInner createOrUpdate( + String resourceGroupName, String jitRequestName, JitRequestDefinitionInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, jitRequestName, parameters, context).block(); + } + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String jitRequestName, JitRequestPatchable 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jitRequestName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String jitRequestName, JitRequestPatchable 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jitRequestName, + parameters, + accept, + context); + } + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String jitRequestName, JitRequestPatchable parameters) { + return updateWithResponseAsync(resourceGroupName, jitRequestName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 JIT request definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JitRequestDefinitionInner update( + String resourceGroupName, String jitRequestName, JitRequestPatchable parameters) { + return updateAsync(resourceGroupName, jitRequestName, parameters).block(); + } + + /** + * Updates the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @param parameters Parameters supplied to the update JIT request. + * @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 JIT request definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String jitRequestName, JitRequestPatchable parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, jitRequestName, parameters, context).block(); + } + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 jitRequestName) { + 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName 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(), + jitRequestName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 jitRequestName, 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 (jitRequestName == null) { + return Mono.error(new IllegalArgumentException("Parameter jitRequestName 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(), + jitRequestName, + accept, + context); + } + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 jitRequestName) { + return deleteWithResponseAsync(resourceGroupName, jitRequestName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 jitRequestName) { + deleteAsync(resourceGroupName, jitRequestName).block(); + } + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 jitRequestName, Context context) { + return deleteWithResponseAsync(resourceGroupName, jitRequestName, context).block(); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionWithResponseAsync() { + 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 + .listBySubscription( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionWithResponseAsync(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 + .listBySubscription( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listBySubscriptionAsync() { + return listBySubscriptionWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JitRequestDefinitionListResultInner listBySubscription() { + return listBySubscriptionAsync().block(); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBySubscriptionWithResponse(Context context) { + return listBySubscriptionWithResponseAsync(context).block(); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupWithResponseAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupWithResponseAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JitRequestDefinitionListResultInner listByResourceGroup(String resourceGroupName) { + return listByResourceGroupAsync(resourceGroupName).block(); + } + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + return listByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsImpl.java new file mode 100644 index 000000000000..37a89b4c05de --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.solutions.fluent.JitRequestsClient; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionInner; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionListResultInner; +import com.azure.resourcemanager.solutions.models.JitRequestDefinition; +import com.azure.resourcemanager.solutions.models.JitRequestDefinitionListResult; +import com.azure.resourcemanager.solutions.models.JitRequests; + +public final class JitRequestsImpl implements JitRequests { + private static final ClientLogger LOGGER = new ClientLogger(JitRequestsImpl.class); + + private final JitRequestsClient innerClient; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + public JitRequestsImpl( + JitRequestsClient innerClient, com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public JitRequestDefinition getByResourceGroup(String resourceGroupName, String jitRequestName) { + JitRequestDefinitionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, jitRequestName); + if (inner != null) { + return new JitRequestDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String jitRequestName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, jitRequestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JitRequestDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String jitRequestName) { + this.serviceClient().delete(resourceGroupName, jitRequestName); + } + + public Response deleteWithResponse(String resourceGroupName, String jitRequestName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, jitRequestName, context); + } + + public JitRequestDefinitionListResult listBySubscription() { + JitRequestDefinitionListResultInner inner = this.serviceClient().listBySubscription(); + if (inner != null) { + return new JitRequestDefinitionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listBySubscriptionWithResponse(Context context) { + Response inner = + this.serviceClient().listBySubscriptionWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JitRequestDefinitionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public JitRequestDefinitionListResult listByResourceGroup(String resourceGroupName) { + JitRequestDefinitionListResultInner inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return new JitRequestDefinitionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + Response inner = + this.serviceClient().listByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JitRequestDefinitionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public JitRequestDefinition 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 jitRequestName = Utils.getValueFromIdByName(id, "jitRequests"); + if (jitRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jitRequests'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, jitRequestName, 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 jitRequestName = Utils.getValueFromIdByName(id, "jitRequests"); + if (jitRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jitRequests'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, jitRequestName, 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 jitRequestName = Utils.getValueFromIdByName(id, "jitRequests"); + if (jitRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jitRequests'.", id))); + } + this.deleteWithResponse(resourceGroupName, jitRequestName, 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 jitRequestName = Utils.getValueFromIdByName(id, "jitRequests"); + if (jitRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jitRequests'.", id))); + } + return this.deleteWithResponse(resourceGroupName, jitRequestName, context); + } + + private JitRequestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } + + public JitRequestDefinitionImpl define(String name) { + return new JitRequestDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedApplicationManagementClientBuilder.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedApplicationManagementClientBuilder.java new file mode 100644 index 000000000000..ab583acd56f2 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedApplicationManagementClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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 ManagedApplicationManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ManagedApplicationManagementClientImpl.class}) +public final class ManagedApplicationManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ManagedApplicationManagementClientBuilder. + */ + public ManagedApplicationManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ManagedApplicationManagementClientBuilder. + */ + public ManagedApplicationManagementClientBuilder 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 ManagedApplicationManagementClientBuilder. + */ + public ManagedApplicationManagementClientBuilder 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 ManagedApplicationManagementClientBuilder. + */ + public ManagedApplicationManagementClientBuilder 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 ManagedApplicationManagementClientBuilder. + */ + public ManagedApplicationManagementClientBuilder 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 ManagedApplicationManagementClientBuilder. + */ + public ManagedApplicationManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ManagedApplicationManagementClientImpl with the provided parameters. + * + * @return an instance of ManagedApplicationManagementClientImpl. + */ + public ManagedApplicationManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ManagedApplicationManagementClientImpl client = + new ManagedApplicationManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedApplicationManagementClientImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedApplicationManagementClientImpl.java new file mode 100644 index 000000000000..b863cb80d5c7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedApplicationManagementClientImpl.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.ApplicationDefinitionsClient; +import com.azure.resourcemanager.solutions.fluent.ApplicationsClient; +import com.azure.resourcemanager.solutions.fluent.JitRequestsClient; +import com.azure.resourcemanager.solutions.fluent.ManagedApplicationManagementClient; +import com.azure.resourcemanager.solutions.fluent.ResourceProvidersClient; +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 ManagedApplicationManagementClientImpl type. */ +@ServiceClient(builder = ManagedApplicationManagementClientBuilder.class) +public final class ManagedApplicationManagementClientImpl implements ManagedApplicationManagementClient { + /** 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 ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The ApplicationsClient object to access its operations. */ + private final ApplicationsClient applications; + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + public ApplicationsClient getApplications() { + return this.applications; + } + + /** The ApplicationDefinitionsClient object to access its operations. */ + private final ApplicationDefinitionsClient applicationDefinitions; + + /** + * Gets the ApplicationDefinitionsClient object to access its operations. + * + * @return the ApplicationDefinitionsClient object. + */ + public ApplicationDefinitionsClient getApplicationDefinitions() { + return this.applicationDefinitions; + } + + /** The JitRequestsClient object to access its operations. */ + private final JitRequestsClient jitRequests; + + /** + * Gets the JitRequestsClient object to access its operations. + * + * @return the JitRequestsClient object. + */ + public JitRequestsClient getJitRequests() { + return this.jitRequests; + } + + /** + * Initializes an instance of ManagedApplicationManagementClient 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. + */ + ManagedApplicationManagementClientImpl( + 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 = "2021-07-01"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.applications = new ApplicationsClientImpl(this); + this.applicationDefinitions = new ApplicationDefinitionsClientImpl(this); + this.jitRequests = new JitRequestsClientImpl(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(ManagedApplicationManagementClientImpl.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedIdentityTokenResultImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedIdentityTokenResultImpl.java new file mode 100644 index 000000000000..076c0bf553d8 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ManagedIdentityTokenResultImpl.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.solutions.implementation; + +import com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner; +import com.azure.resourcemanager.solutions.models.ManagedIdentityToken; +import com.azure.resourcemanager.solutions.models.ManagedIdentityTokenResult; +import java.util.Collections; +import java.util.List; + +public final class ManagedIdentityTokenResultImpl implements ManagedIdentityTokenResult { + private ManagedIdentityTokenResultInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + ManagedIdentityTokenResultImpl( + ManagedIdentityTokenResultInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedIdentityTokenResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/OperationImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/OperationImpl.java new file mode 100644 index 000000000000..2686d116c4df --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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.solutions.implementation; + +import com.azure.resourcemanager.solutions.fluent.models.OperationInner; +import com.azure.resourcemanager.solutions.models.ActionType; +import com.azure.resourcemanager.solutions.models.Operation; +import com.azure.resourcemanager.solutions.models.OperationDisplay; +import com.azure.resourcemanager.solutions.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.solutions.ManagedApplicationManager 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.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ResourceProvidersClientImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 000000000000..55edbbd5b0e4 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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.solutions.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.solutions.fluent.models.OperationInner; +import com.azure.resourcemanager.solutions.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final ManagedApplicationManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(ManagedApplicationManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ManagedApplicationManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ManagedApplicationMa") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Solutions/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOperations( + @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> listOperationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Microsoft.Solutions 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> listOperationsSinglePageAsync() { + 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.listOperations(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 Microsoft.Solutions 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> listOperationsSinglePageAsync(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 + .listOperations(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 Microsoft.Solutions 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 listOperationsAsync() { + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(), nextLink -> listOperationsNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Microsoft.Solutions 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 listOperationsAsync(Context context) { + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(context), + nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Microsoft.Solutions 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 listOperations() { + return new PagedIterable<>(listOperationsAsync()); + } + + /** + * Lists all of the available Microsoft.Solutions 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 listOperations(Context context) { + return new PagedIterable<>(listOperationsAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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> listOperationsNextSinglePageAsync(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.listOperationsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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> listOperationsNextSinglePageAsync(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 + .listOperationsNext(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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ResourceProvidersImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..77959f670c59 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ResourceProvidersImpl.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.solutions.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.solutions.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.solutions.fluent.models.OperationInner; +import com.azure.resourcemanager.solutions.models.Operation; +import com.azure.resourcemanager.solutions.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listOperations() { + PagedIterable inner = this.serviceClient().listOperations(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable listOperations(Context context) { + PagedIterable inner = this.serviceClient().listOperations(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/UpdateAccessDefinitionImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/UpdateAccessDefinitionImpl.java new file mode 100644 index 000000000000..75434d29cf2b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/UpdateAccessDefinitionImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.implementation; + +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.JitRequestMetadata; +import com.azure.resourcemanager.solutions.models.Status; +import com.azure.resourcemanager.solutions.models.Substatus; +import com.azure.resourcemanager.solutions.models.UpdateAccessDefinition; + +public final class UpdateAccessDefinitionImpl implements UpdateAccessDefinition { + private UpdateAccessDefinitionInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + UpdateAccessDefinitionImpl( + UpdateAccessDefinitionInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String approver() { + return this.innerModel().approver(); + } + + public JitRequestMetadata metadata() { + return this.innerModel().metadata(); + } + + public Status status() { + return this.innerModel().status(); + } + + public Substatus subStatus() { + return this.innerModel().subStatus(); + } + + public UpdateAccessDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.solutions.ManagedApplicationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/Utils.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/Utils.java new file mode 100644 index 000000000000..0ad95d436413 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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.solutions.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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/package-info.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/package-info.java new file mode 100644 index 000000000000..a1a5122999e9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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 ManagedApplicationManagementClient. Managed Application Client. */ +package com.azure.resourcemanager.solutions.implementation; diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ActionType.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ActionType.java new file mode 100644 index 000000000000..c813900b3929 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/AllowedUpgradePlansResult.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/AllowedUpgradePlansResult.java new file mode 100644 index 000000000000..2b419a496fe5 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/AllowedUpgradePlansResult.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.solutions.models; + +import com.azure.resourcemanager.solutions.fluent.models.AllowedUpgradePlansResultInner; +import java.util.List; + +/** An immutable client-side representation of AllowedUpgradePlansResult. */ +public interface AllowedUpgradePlansResult { + /** + * Gets the value property: The array of plans. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.solutions.fluent.models.AllowedUpgradePlansResultInner object. + * + * @return the inner object. + */ + AllowedUpgradePlansResultInner innerModel(); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Application.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Application.java new file mode 100644 index 000000000000..1468eba8a6ac --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Application.java @@ -0,0 +1,646 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Application. */ +public interface Application { + /** + * 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 managedBy property: ID of the resource that manages this resource. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the sku property: The SKU of the resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the plan property: The plan information. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the kind property: The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the managedResourceGroupId property: The managed resource group Id. + * + * @return the managedResourceGroupId value. + */ + String managedResourceGroupId(); + + /** + * Gets the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @return the applicationDefinitionId value. + */ + String applicationDefinitionId(); + + /** + * Gets the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @return the parameters value. + */ + Object parameters(); + + /** + * Gets the outputs property: Name and value pairs that define the managed application outputs. + * + * @return the outputs value. + */ + Object outputs(); + + /** + * Gets the provisioningState property: The managed application provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the billingDetails property: The managed application billing details. + * + * @return the billingDetails value. + */ + ApplicationBillingDetailsDefinition billingDetails(); + + /** + * Gets the jitAccessPolicy property: The managed application Jit access policy. + * + * @return the jitAccessPolicy value. + */ + ApplicationJitAccessPolicy jitAccessPolicy(); + + /** + * Gets the publisherTenantId property: The publisher tenant Id. + * + * @return the publisherTenantId value. + */ + String publisherTenantId(); + + /** + * Gets the authorizations property: The read-only authorizations property that is retrieved from the application + * package. + * + * @return the authorizations value. + */ + List authorizations(); + + /** + * Gets the managementMode property: The managed application management mode. + * + * @return the managementMode value. + */ + ApplicationManagementMode managementMode(); + + /** + * Gets the customerSupport property: The read-only customer support property that is retrieved from the application + * package. + * + * @return the customerSupport value. + */ + ApplicationPackageContact customerSupport(); + + /** + * Gets the supportUrls property: The read-only support URLs property that is retrieved from the application + * package. + * + * @return the supportUrls value. + */ + ApplicationPackageSupportUrls supportUrls(); + + /** + * Gets the artifacts property: The collection of managed application artifacts. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + ApplicationClientDetails createdBy(); + + /** + * Gets the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + ApplicationClientDetails updatedBy(); + + /** + * 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.solutions.fluent.models.ApplicationInner object. + * + * @return the inner object. + */ + ApplicationInner innerModel(); + + /** The entirety of the Application definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + /** The Application definition stages. */ + interface DefinitionStages { + /** The first stage of the Application definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Application 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 Application 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 Application definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of the managed application. Allowed values are MarketPlace and + * ServiceCatalog.. + * + * @param kind The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + /** + * The stage of the Application 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.WithManagedBy, + DefinitionStages.WithSku, + DefinitionStages.WithPlan, + DefinitionStages.WithIdentity, + DefinitionStages.WithManagedResourceGroupId, + DefinitionStages.WithApplicationDefinitionId, + DefinitionStages.WithParameters, + DefinitionStages.WithJitAccessPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + Application create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Application create(Context context); + } + /** The stage of the Application 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 Application definition allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: ID of the resource that manages this resource.. + * + * @param managedBy ID of the resource that manages this resource. + * @return the next definition stage. + */ + WithCreate withManagedBy(String managedBy); + } + /** The stage of the Application definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the resource.. + * + * @param sku The SKU of the resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the Application definition allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: The plan information.. + * + * @param plan The plan information. + * @return the next definition stage. + */ + WithCreate withPlan(Plan plan); + } + /** The stage of the Application definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the Application definition allowing to specify managedResourceGroupId. */ + interface WithManagedResourceGroupId { + /** + * Specifies the managedResourceGroupId property: The managed resource group Id.. + * + * @param managedResourceGroupId The managed resource group Id. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupId(String managedResourceGroupId); + } + /** The stage of the Application definition allowing to specify applicationDefinitionId. */ + interface WithApplicationDefinitionId { + /** + * Specifies the applicationDefinitionId property: The fully qualified path of managed application + * definition Id.. + * + * @param applicationDefinitionId The fully qualified path of managed application definition Id. + * @return the next definition stage. + */ + WithCreate withApplicationDefinitionId(String applicationDefinitionId); + } + /** The stage of the Application definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: Name and value pairs that define the managed application parameters. + * It can be a JObject or a well formed JSON string.. + * + * @param parameters Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * @return the next definition stage. + */ + WithCreate withParameters(Object parameters); + } + /** The stage of the Application definition allowing to specify jitAccessPolicy. */ + interface WithJitAccessPolicy { + /** + * Specifies the jitAccessPolicy property: The managed application Jit access policy.. + * + * @param jitAccessPolicy The managed application Jit access policy. + * @return the next definition stage. + */ + WithCreate withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy); + } + } + /** + * Begins update for the Application resource. + * + * @return the stage of resource update. + */ + Application.Update update(); + + /** The template for Application update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithManagedBy, + UpdateStages.WithSku, + UpdateStages.WithPlan, + UpdateStages.WithKind, + UpdateStages.WithIdentity, + UpdateStages.WithManagedResourceGroupId, + UpdateStages.WithApplicationDefinitionId, + UpdateStages.WithParameters, + UpdateStages.WithJitAccessPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Application apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Application apply(Context context); + } + /** The Application update stages. */ + interface UpdateStages { + /** The stage of the Application 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 Application update allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: ID of the resource that manages this resource.. + * + * @param managedBy ID of the resource that manages this resource. + * @return the next definition stage. + */ + Update withManagedBy(String managedBy); + } + /** The stage of the Application update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the resource.. + * + * @param sku The SKU of the resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the Application update allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: The plan information.. + * + * @param plan The plan information. + * @return the next definition stage. + */ + Update withPlan(PlanPatchable plan); + } + /** The stage of the Application update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of the managed application. Allowed values are MarketPlace and + * ServiceCatalog.. + * + * @param kind The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * @return the next definition stage. + */ + Update withKind(String kind); + } + /** The stage of the Application update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + /** The stage of the Application update allowing to specify managedResourceGroupId. */ + interface WithManagedResourceGroupId { + /** + * Specifies the managedResourceGroupId property: The managed resource group Id.. + * + * @param managedResourceGroupId The managed resource group Id. + * @return the next definition stage. + */ + Update withManagedResourceGroupId(String managedResourceGroupId); + } + /** The stage of the Application update allowing to specify applicationDefinitionId. */ + interface WithApplicationDefinitionId { + /** + * Specifies the applicationDefinitionId property: The fully qualified path of managed application + * definition Id.. + * + * @param applicationDefinitionId The fully qualified path of managed application definition Id. + * @return the next definition stage. + */ + Update withApplicationDefinitionId(String applicationDefinitionId); + } + /** The stage of the Application update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: Name and value pairs that define the managed application parameters. + * It can be a JObject or a well formed JSON string.. + * + * @param parameters Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * @return the next definition stage. + */ + Update withParameters(Object parameters); + } + /** The stage of the Application update allowing to specify jitAccessPolicy. */ + interface WithJitAccessPolicy { + /** + * Specifies the jitAccessPolicy property: The managed application Jit access policy.. + * + * @param jitAccessPolicy The managed application Jit access policy. + * @return the next definition stage. + */ + Update withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Application refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Application refresh(Context context); + + /** + * Refresh Permissions for application. + * + * @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 refreshPermissions(); + + /** + * Refresh Permissions for application. + * + * @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 refreshPermissions(Context context); + + /** + * List allowed upgrade plans for application. + * + * @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 array of plan. + */ + AllowedUpgradePlansResult listAllowedUpgradePlans(); + + /** + * List allowed upgrade plans for application. + * + * @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 array of plan along with {@link Response}. + */ + Response listAllowedUpgradePlansWithResponse(Context context); + + /** + * Update access for application. + * + * @param parameters Request body parameters to list tokens. + * @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. + */ + UpdateAccessDefinition updateAccess(UpdateAccessDefinitionInner parameters); + + /** + * Update access for application. + * + * @param parameters Request body parameters to list tokens. + * @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. + */ + UpdateAccessDefinition updateAccess(UpdateAccessDefinitionInner parameters, Context context); + + /** + * List tokens for application. + * + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens. + */ + ManagedIdentityTokenResult listTokens(ListTokenRequest parameters); + + /** + * List tokens for application. + * + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens along with {@link Response}. + */ + Response listTokensWithResponse(ListTokenRequest parameters, Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifact.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifact.java new file mode 100644 index 000000000000..27ebc8f45f5d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifact.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed application artifact. */ +@Fluent +public final class ApplicationArtifact { + /* + * The managed application artifact name. + */ + @JsonProperty(value = "name", required = true) + private ApplicationArtifactName name; + + /* + * The managed application artifact blob uri. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * The managed application artifact type. + */ + @JsonProperty(value = "type", required = true) + private ApplicationArtifactType type; + + /** + * Get the name property: The managed application artifact name. + * + * @return the name value. + */ + public ApplicationArtifactName name() { + return this.name; + } + + /** + * Set the name property: The managed application artifact name. + * + * @param name the name value to set. + * @return the ApplicationArtifact object itself. + */ + public ApplicationArtifact withName(ApplicationArtifactName name) { + this.name = name; + return this; + } + + /** + * Get the uri property: The managed application artifact blob uri. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The managed application artifact blob uri. + * + * @param uri the uri value to set. + * @return the ApplicationArtifact object itself. + */ + public ApplicationArtifact withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the type property: The managed application artifact type. + * + * @return the type value. + */ + public ApplicationArtifactType type() { + return this.type; + } + + /** + * Set the type property: The managed application artifact type. + * + * @param type the type value to set. + * @return the ApplicationArtifact object itself. + */ + public ApplicationArtifact withType(ApplicationArtifactType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ApplicationArtifact")); + } + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model ApplicationArtifact")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ApplicationArtifact")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationArtifact.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactName.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactName.java new file mode 100644 index 000000000000..5ff0cb08d900 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactName.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The managed application artifact name. */ +public final class ApplicationArtifactName extends ExpandableStringEnum { + /** Static value NotSpecified for ApplicationArtifactName. */ + public static final ApplicationArtifactName NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value ViewDefinition for ApplicationArtifactName. */ + public static final ApplicationArtifactName VIEW_DEFINITION = fromString("ViewDefinition"); + + /** Static value Authorizations for ApplicationArtifactName. */ + public static final ApplicationArtifactName AUTHORIZATIONS = fromString("Authorizations"); + + /** Static value CustomRoleDefinition for ApplicationArtifactName. */ + public static final ApplicationArtifactName CUSTOM_ROLE_DEFINITION = fromString("CustomRoleDefinition"); + + /** + * Creates or finds a ApplicationArtifactName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationArtifactName. + */ + @JsonCreator + public static ApplicationArtifactName fromString(String name) { + return fromString(name, ApplicationArtifactName.class); + } + + /** + * Gets known ApplicationArtifactName values. + * + * @return known ApplicationArtifactName values. + */ + public static Collection values() { + return values(ApplicationArtifactName.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactType.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactType.java new file mode 100644 index 000000000000..915ed81d3b41 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The managed application artifact type. */ +public enum ApplicationArtifactType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value Template. */ + TEMPLATE("Template"), + + /** Enum value Custom. */ + CUSTOM("Custom"); + + /** The actual serialized value for a ApplicationArtifactType instance. */ + private final String value; + + ApplicationArtifactType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ApplicationArtifactType instance. + * + * @param value the serialized value to parse. + * @return the parsed ApplicationArtifactType object, or null if unable to parse. + */ + @JsonCreator + public static ApplicationArtifactType fromString(String value) { + if (value == null) { + return null; + } + ApplicationArtifactType[] items = ApplicationArtifactType.values(); + for (ApplicationArtifactType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationAuthorization.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationAuthorization.java new file mode 100644 index 000000000000..42d9ad708a2c --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationAuthorization.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The managed application provider authorization. */ +@Fluent +public final class ApplicationAuthorization { + /* + * The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the + * managed application resources. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The provider's role definition identifier. This role will define all the permissions that the provider must have + * on the managed application's container resource group. This role definition cannot have permission to delete the + * resource group. + */ + @JsonProperty(value = "roleDefinitionId", required = true) + private String roleDefinitionId; + + /** + * Get the principalId property: The provider's principal identifier. This is the identity that the provider will + * use to call ARM to manage the managed application resources. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The provider's principal identifier. This is the identity that the provider will + * use to call ARM to manage the managed application resources. + * + * @param principalId the principalId value to set. + * @return the ApplicationAuthorization object itself. + */ + public ApplicationAuthorization withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the roleDefinitionId property: The provider's role definition identifier. This role will define all the + * permissions that the provider must have on the managed application's container resource group. This role + * definition cannot have permission to delete the resource group. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The provider's role definition identifier. This role will define all the + * permissions that the provider must have on the managed application's container resource group. This role + * definition cannot have permission to delete the resource group. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the ApplicationAuthorization object itself. + */ + public ApplicationAuthorization withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model ApplicationAuthorization")); + } + if (roleDefinitionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleDefinitionId in model ApplicationAuthorization")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationAuthorization.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationBillingDetailsDefinition.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationBillingDetailsDefinition.java new file mode 100644 index 000000000000..50fd157ae95b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationBillingDetailsDefinition.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed application billing details definition. */ +@Fluent +public final class ApplicationBillingDetailsDefinition { + /* + * The managed application resource usage Id. + */ + @JsonProperty(value = "resourceUsageId") + private String resourceUsageId; + + /** + * Get the resourceUsageId property: The managed application resource usage Id. + * + * @return the resourceUsageId value. + */ + public String resourceUsageId() { + return this.resourceUsageId; + } + + /** + * Set the resourceUsageId property: The managed application resource usage Id. + * + * @param resourceUsageId the resourceUsageId value to set. + * @return the ApplicationBillingDetailsDefinition object itself. + */ + public ApplicationBillingDetailsDefinition withResourceUsageId(String resourceUsageId) { + this.resourceUsageId = resourceUsageId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationClientDetails.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationClientDetails.java new file mode 100644 index 000000000000..971c19e9069e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationClientDetails.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The application client details to track the entity creating/updating the managed app resource. */ +@Fluent +public final class ApplicationClientDetails { + /* + * The client Oid. + */ + @JsonProperty(value = "oid") + private String oid; + + /* + * The client Puid + */ + @JsonProperty(value = "puid") + private String puid; + + /* + * The client application Id. + */ + @JsonProperty(value = "applicationId") + private String applicationId; + + /** + * Get the oid property: The client Oid. + * + * @return the oid value. + */ + public String oid() { + return this.oid; + } + + /** + * Set the oid property: The client Oid. + * + * @param oid the oid value to set. + * @return the ApplicationClientDetails object itself. + */ + public ApplicationClientDetails withOid(String oid) { + this.oid = oid; + return this; + } + + /** + * Get the puid property: The client Puid. + * + * @return the puid value. + */ + public String puid() { + return this.puid; + } + + /** + * Set the puid property: The client Puid. + * + * @param puid the puid value to set. + * @return the ApplicationClientDetails object itself. + */ + public ApplicationClientDetails withPuid(String puid) { + this.puid = puid; + return this; + } + + /** + * Get the applicationId property: The client application Id. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The client application Id. + * + * @param applicationId the applicationId value to set. + * @return the ApplicationClientDetails object itself. + */ + public ApplicationClientDetails withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinition.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinition.java new file mode 100644 index 000000000000..b994502303d3 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinition.java @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationDefinition. */ +public interface ApplicationDefinition { + /** + * 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 managedBy property: ID of the resource that manages this resource. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the sku property: The SKU of the resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the lockLevel property: The managed application lock level. + * + * @return the lockLevel value. + */ + ApplicationLockLevel lockLevel(); + + /** + * Gets the displayName property: The managed application definition display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the isEnabled property: A value indicating whether the package is enabled or not. + * + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * Gets the authorizations property: The managed application provider authorizations. + * + * @return the authorizations value. + */ + List authorizations(); + + /** + * Gets the artifacts property: The collection of managed application artifacts. The portal will use the files + * specified as artifacts to construct the user experience of creating a managed application from a managed + * application definition. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the description property: The managed application definition description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the packageFileUri property: The managed application definition package file Uri. Use this element. + * + * @return the packageFileUri value. + */ + String packageFileUri(); + + /** + * Gets the storageAccountId property: The storage account id for bring your own storage scenario. + * + * @return the storageAccountId value. + */ + String storageAccountId(); + + /** + * Gets the mainTemplate property: The inline main template json which has resources to be provisioned. It can be a + * JObject or well-formed JSON string. + * + * @return the mainTemplate value. + */ + Object mainTemplate(); + + /** + * Gets the createUiDefinition property: The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. + * + * @return the createUiDefinition value. + */ + Object createUiDefinition(); + + /** + * Gets the notificationPolicy property: The managed application notification policy. + * + * @return the notificationPolicy value. + */ + ApplicationNotificationPolicy notificationPolicy(); + + /** + * Gets the lockingPolicy property: The managed application locking policy. + * + * @return the lockingPolicy value. + */ + ApplicationPackageLockingPolicyDefinition lockingPolicy(); + + /** + * Gets the deploymentPolicy property: The managed application deployment policy. + * + * @return the deploymentPolicy value. + */ + ApplicationDeploymentPolicy deploymentPolicy(); + + /** + * Gets the managementPolicy property: The managed application management policy that determines publisher's access + * to the managed resource group. + * + * @return the managementPolicy value. + */ + ApplicationManagementPolicy managementPolicy(); + + /** + * Gets the policies property: The managed application provider policies. + * + * @return the policies value. + */ + List policies(); + + /** + * 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.solutions.fluent.models.ApplicationDefinitionInner object. + * + * @return the inner object. + */ + ApplicationDefinitionInner innerModel(); + + /** The entirety of the ApplicationDefinition definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithLockLevel, + DefinitionStages.WithCreate { + } + /** The ApplicationDefinition definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationDefinition definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApplicationDefinition 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 ApplicationDefinition 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. + */ + WithLockLevel withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the ApplicationDefinition definition allowing to specify lockLevel. */ + interface WithLockLevel { + /** + * Specifies the lockLevel property: The managed application lock level.. + * + * @param lockLevel The managed application lock level. + * @return the next definition stage. + */ + WithCreate withLockLevel(ApplicationLockLevel lockLevel); + } + /** + * The stage of the ApplicationDefinition 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.WithManagedBy, + DefinitionStages.WithSku, + DefinitionStages.WithDisplayName, + DefinitionStages.WithIsEnabled, + DefinitionStages.WithAuthorizations, + DefinitionStages.WithArtifacts, + DefinitionStages.WithDescription, + DefinitionStages.WithPackageFileUri, + DefinitionStages.WithStorageAccountId, + DefinitionStages.WithMainTemplate, + DefinitionStages.WithCreateUiDefinition, + DefinitionStages.WithNotificationPolicy, + DefinitionStages.WithLockingPolicy, + DefinitionStages.WithDeploymentPolicy, + DefinitionStages.WithManagementPolicy, + DefinitionStages.WithPolicies { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationDefinition create(Context context); + } + /** The stage of the ApplicationDefinition 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 ApplicationDefinition definition allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: ID of the resource that manages this resource.. + * + * @param managedBy ID of the resource that manages this resource. + * @return the next definition stage. + */ + WithCreate withManagedBy(String managedBy); + } + /** The stage of the ApplicationDefinition definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the resource.. + * + * @param sku The SKU of the resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the ApplicationDefinition definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The managed application definition display name.. + * + * @param displayName The managed application definition display name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the ApplicationDefinition definition allowing to specify isEnabled. */ + interface WithIsEnabled { + /** + * Specifies the isEnabled property: A value indicating whether the package is enabled or not.. + * + * @param isEnabled A value indicating whether the package is enabled or not. + * @return the next definition stage. + */ + WithCreate withIsEnabled(Boolean isEnabled); + } + /** The stage of the ApplicationDefinition definition allowing to specify authorizations. */ + interface WithAuthorizations { + /** + * Specifies the authorizations property: The managed application provider authorizations.. + * + * @param authorizations The managed application provider authorizations. + * @return the next definition stage. + */ + WithCreate withAuthorizations(List authorizations); + } + /** The stage of the ApplicationDefinition definition allowing to specify artifacts. */ + interface WithArtifacts { + /** + * Specifies the artifacts property: The collection of managed application artifacts. The portal will use + * the files specified as artifacts to construct the user experience of creating a managed application from + * a managed application definition.. + * + * @param artifacts The collection of managed application artifacts. The portal will use the files specified + * as artifacts to construct the user experience of creating a managed application from a managed + * application definition. + * @return the next definition stage. + */ + WithCreate withArtifacts(List artifacts); + } + /** The stage of the ApplicationDefinition definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The managed application definition description.. + * + * @param description The managed application definition description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ApplicationDefinition definition allowing to specify packageFileUri. */ + interface WithPackageFileUri { + /** + * Specifies the packageFileUri property: The managed application definition package file Uri. Use this + * element. + * + * @param packageFileUri The managed application definition package file Uri. Use this element. + * @return the next definition stage. + */ + WithCreate withPackageFileUri(String packageFileUri); + } + /** The stage of the ApplicationDefinition definition allowing to specify storageAccountId. */ + interface WithStorageAccountId { + /** + * Specifies the storageAccountId property: The storage account id for bring your own storage scenario.. + * + * @param storageAccountId The storage account id for bring your own storage scenario. + * @return the next definition stage. + */ + WithCreate withStorageAccountId(String storageAccountId); + } + /** The stage of the ApplicationDefinition definition allowing to specify mainTemplate. */ + interface WithMainTemplate { + /** + * Specifies the mainTemplate property: The inline main template json which has resources to be provisioned. + * It can be a JObject or well-formed JSON string.. + * + * @param mainTemplate The inline main template json which has resources to be provisioned. It can be a + * JObject or well-formed JSON string. + * @return the next definition stage. + */ + WithCreate withMainTemplate(Object mainTemplate); + } + /** The stage of the ApplicationDefinition definition allowing to specify createUiDefinition. */ + interface WithCreateUiDefinition { + /** + * Specifies the createUiDefinition property: The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string.. + * + * @param createUiDefinition The createUiDefinition json for the backing template with + * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string. + * @return the next definition stage. + */ + WithCreate withCreateUiDefinition(Object createUiDefinition); + } + /** The stage of the ApplicationDefinition definition allowing to specify notificationPolicy. */ + interface WithNotificationPolicy { + /** + * Specifies the notificationPolicy property: The managed application notification policy.. + * + * @param notificationPolicy The managed application notification policy. + * @return the next definition stage. + */ + WithCreate withNotificationPolicy(ApplicationNotificationPolicy notificationPolicy); + } + /** The stage of the ApplicationDefinition definition allowing to specify lockingPolicy. */ + interface WithLockingPolicy { + /** + * Specifies the lockingPolicy property: The managed application locking policy.. + * + * @param lockingPolicy The managed application locking policy. + * @return the next definition stage. + */ + WithCreate withLockingPolicy(ApplicationPackageLockingPolicyDefinition lockingPolicy); + } + /** The stage of the ApplicationDefinition definition allowing to specify deploymentPolicy. */ + interface WithDeploymentPolicy { + /** + * Specifies the deploymentPolicy property: The managed application deployment policy.. + * + * @param deploymentPolicy The managed application deployment policy. + * @return the next definition stage. + */ + WithCreate withDeploymentPolicy(ApplicationDeploymentPolicy deploymentPolicy); + } + /** The stage of the ApplicationDefinition definition allowing to specify managementPolicy. */ + interface WithManagementPolicy { + /** + * Specifies the managementPolicy property: The managed application management policy that determines + * publisher's access to the managed resource group.. + * + * @param managementPolicy The managed application management policy that determines publisher's access to + * the managed resource group. + * @return the next definition stage. + */ + WithCreate withManagementPolicy(ApplicationManagementPolicy managementPolicy); + } + /** The stage of the ApplicationDefinition definition allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: The managed application provider policies.. + * + * @param policies The managed application provider policies. + * @return the next definition stage. + */ + WithCreate withPolicies(List policies); + } + } + /** + * Begins update for the ApplicationDefinition resource. + * + * @return the stage of resource update. + */ + ApplicationDefinition.Update update(); + + /** The template for ApplicationDefinition update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationDefinition apply(Context context); + } + /** The ApplicationDefinition update stages. */ + interface UpdateStages { + /** The stage of the ApplicationDefinition update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Application definition tags. + * + * @param tags Application definition tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationDefinition refresh(Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifact.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifact.java new file mode 100644 index 000000000000..0c887edc19b6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifact.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application definition artifact. */ +@Fluent +public final class ApplicationDefinitionArtifact { + /* + * The managed application definition artifact name. + */ + @JsonProperty(value = "name", required = true) + private ApplicationDefinitionArtifactName name; + + /* + * The managed application definition artifact blob uri. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * The managed application definition artifact type. + */ + @JsonProperty(value = "type", required = true) + private ApplicationArtifactType type; + + /** + * Get the name property: The managed application definition artifact name. + * + * @return the name value. + */ + public ApplicationDefinitionArtifactName name() { + return this.name; + } + + /** + * Set the name property: The managed application definition artifact name. + * + * @param name the name value to set. + * @return the ApplicationDefinitionArtifact object itself. + */ + public ApplicationDefinitionArtifact withName(ApplicationDefinitionArtifactName name) { + this.name = name; + return this; + } + + /** + * Get the uri property: The managed application definition artifact blob uri. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The managed application definition artifact blob uri. + * + * @param uri the uri value to set. + * @return the ApplicationDefinitionArtifact object itself. + */ + public ApplicationDefinitionArtifact withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the type property: The managed application definition artifact type. + * + * @return the type value. + */ + public ApplicationArtifactType type() { + return this.type; + } + + /** + * Set the type property: The managed application definition artifact type. + * + * @param type the type value to set. + * @return the ApplicationDefinitionArtifact object itself. + */ + public ApplicationDefinitionArtifact withType(ApplicationArtifactType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ApplicationDefinitionArtifact")); + } + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property uri in model ApplicationDefinitionArtifact")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model ApplicationDefinitionArtifact")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationDefinitionArtifact.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifactName.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifactName.java new file mode 100644 index 000000000000..c3a3ed9afb8d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifactName.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The managed application artifact name. */ +public final class ApplicationDefinitionArtifactName extends ExpandableStringEnum { + /** Static value NotSpecified for ApplicationDefinitionArtifactName. */ + public static final ApplicationDefinitionArtifactName NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value ApplicationResourceTemplate for ApplicationDefinitionArtifactName. */ + public static final ApplicationDefinitionArtifactName APPLICATION_RESOURCE_TEMPLATE = + fromString("ApplicationResourceTemplate"); + + /** Static value CreateUiDefinition for ApplicationDefinitionArtifactName. */ + public static final ApplicationDefinitionArtifactName CREATE_UI_DEFINITION = fromString("CreateUiDefinition"); + + /** Static value MainTemplateParameters for ApplicationDefinitionArtifactName. */ + public static final ApplicationDefinitionArtifactName MAIN_TEMPLATE_PARAMETERS = + fromString("MainTemplateParameters"); + + /** + * Creates or finds a ApplicationDefinitionArtifactName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationDefinitionArtifactName. + */ + @JsonCreator + public static ApplicationDefinitionArtifactName fromString(String name) { + return fromString(name, ApplicationDefinitionArtifactName.class); + } + + /** + * Gets known ApplicationDefinitionArtifactName values. + * + * @return known ApplicationDefinitionArtifactName values. + */ + public static Collection values() { + return values(ApplicationDefinitionArtifactName.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionListResult.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionListResult.java new file mode 100644 index 000000000000..789f137dbbb6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionListResult.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of managed application definitions. */ +@Fluent +public final class ApplicationDefinitionListResult { + /* + * The array of managed application definitions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The array of managed application definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The array of managed application definitions. + * + * @param value the value value to set. + * @return the ApplicationDefinitionListResult object itself. + */ + public ApplicationDefinitionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationDefinitionListResult object itself. + */ + public ApplicationDefinitionListResult 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionPatchable.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionPatchable.java new file mode 100644 index 000000000000..ea5a914d40df --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionPatchable.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Information about an application definition request. */ +@Fluent +public final class ApplicationDefinitionPatchable { + /* + * Application definition tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Application definition tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Application definition tags. + * + * @param tags the tags value to set. + * @return the ApplicationDefinitionPatchable object itself. + */ + public ApplicationDefinitionPatchable withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitions.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitions.java new file mode 100644 index 000000000000..c7f76627bc77 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitions.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; + +/** Resource collection API of ApplicationDefinitions. */ +public interface ApplicationDefinitions { + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition. + */ + ApplicationDefinition getByResourceGroup(String resourceGroupName, String applicationDefinitionName); + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 applicationDefinitionName); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 applicationDefinitionName, Context context); + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the managed application definitions in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed application definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the application definitions 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 list of managed application definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition. + */ + ApplicationDefinition getById(String resourceGroupName, String applicationDefinitionName); + + /** + * Gets the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 managed application definition along with {@link Response}. + */ + Response getByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 resourceGroupName, String applicationDefinitionName); + + /** + * Deletes the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @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 resourceGroupName, String applicationDefinitionName, Context context); + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @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 managed application definition. + */ + ApplicationDefinition createOrUpdateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionInner parameters); + + /** + * Creates or updates a managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the create or update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + Response createOrUpdateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionInner parameters, + Context context); + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition. + */ + ApplicationDefinition updateById( + String resourceGroupName, String applicationDefinitionName, ApplicationDefinitionPatchable parameters); + + /** + * Updates the managed application definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationDefinitionName The name of the managed application definition. + * @param parameters Parameters supplied to the update a managed application definition. + * @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 managed application definition along with {@link Response}. + */ + Response updateByIdWithResponse( + String resourceGroupName, + String applicationDefinitionName, + ApplicationDefinitionPatchable parameters, + Context context); + + /** + * Begins definition for a new ApplicationDefinition resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationDefinition definition. + */ + ApplicationDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDeploymentPolicy.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDeploymentPolicy.java new file mode 100644 index 000000000000..c3c76ef2cf6f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDeploymentPolicy.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed application deployment policy. */ +@Fluent +public final class ApplicationDeploymentPolicy { + /* + * The managed application deployment mode. + */ + @JsonProperty(value = "deploymentMode", required = true) + private DeploymentMode deploymentMode; + + /** + * Get the deploymentMode property: The managed application deployment mode. + * + * @return the deploymentMode value. + */ + public DeploymentMode deploymentMode() { + return this.deploymentMode; + } + + /** + * Set the deploymentMode property: The managed application deployment mode. + * + * @param deploymentMode the deploymentMode value to set. + * @return the ApplicationDeploymentPolicy object itself. + */ + public ApplicationDeploymentPolicy withDeploymentMode(DeploymentMode deploymentMode) { + this.deploymentMode = deploymentMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deploymentMode() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentMode in model ApplicationDeploymentPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationDeploymentPolicy.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationJitAccessPolicy.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationJitAccessPolicy.java new file mode 100644 index 000000000000..81f67c2583fb --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationJitAccessPolicy.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Managed application Jit access policy. */ +@Fluent +public final class ApplicationJitAccessPolicy { + /* + * Whether the JIT access is enabled. + */ + @JsonProperty(value = "jitAccessEnabled", required = true) + private boolean jitAccessEnabled; + + /* + * JIT approval mode. + */ + @JsonProperty(value = "jitApprovalMode") + private JitApprovalMode jitApprovalMode; + + /* + * The JIT approvers + */ + @JsonProperty(value = "jitApprovers") + private List jitApprovers; + + /* + * The maximum duration JIT access is granted. This is an ISO8601 time period value. + */ + @JsonProperty(value = "maximumJitAccessDuration") + private String maximumJitAccessDuration; + + /** + * Get the jitAccessEnabled property: Whether the JIT access is enabled. + * + * @return the jitAccessEnabled value. + */ + public boolean jitAccessEnabled() { + return this.jitAccessEnabled; + } + + /** + * Set the jitAccessEnabled property: Whether the JIT access is enabled. + * + * @param jitAccessEnabled the jitAccessEnabled value to set. + * @return the ApplicationJitAccessPolicy object itself. + */ + public ApplicationJitAccessPolicy withJitAccessEnabled(boolean jitAccessEnabled) { + this.jitAccessEnabled = jitAccessEnabled; + return this; + } + + /** + * Get the jitApprovalMode property: JIT approval mode. + * + * @return the jitApprovalMode value. + */ + public JitApprovalMode jitApprovalMode() { + return this.jitApprovalMode; + } + + /** + * Set the jitApprovalMode property: JIT approval mode. + * + * @param jitApprovalMode the jitApprovalMode value to set. + * @return the ApplicationJitAccessPolicy object itself. + */ + public ApplicationJitAccessPolicy withJitApprovalMode(JitApprovalMode jitApprovalMode) { + this.jitApprovalMode = jitApprovalMode; + return this; + } + + /** + * Get the jitApprovers property: The JIT approvers. + * + * @return the jitApprovers value. + */ + public List jitApprovers() { + return this.jitApprovers; + } + + /** + * Set the jitApprovers property: The JIT approvers. + * + * @param jitApprovers the jitApprovers value to set. + * @return the ApplicationJitAccessPolicy object itself. + */ + public ApplicationJitAccessPolicy withJitApprovers(List jitApprovers) { + this.jitApprovers = jitApprovers; + return this; + } + + /** + * Get the maximumJitAccessDuration property: The maximum duration JIT access is granted. This is an ISO8601 time + * period value. + * + * @return the maximumJitAccessDuration value. + */ + public String maximumJitAccessDuration() { + return this.maximumJitAccessDuration; + } + + /** + * Set the maximumJitAccessDuration property: The maximum duration JIT access is granted. This is an ISO8601 time + * period value. + * + * @param maximumJitAccessDuration the maximumJitAccessDuration value to set. + * @return the ApplicationJitAccessPolicy object itself. + */ + public ApplicationJitAccessPolicy withMaximumJitAccessDuration(String maximumJitAccessDuration) { + this.maximumJitAccessDuration = maximumJitAccessDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jitApprovers() != null) { + jitApprovers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationListResult.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationListResult.java new file mode 100644 index 000000000000..f6c67a467b54 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationListResult.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of managed applications. */ +@Fluent +public final class ApplicationListResult { + /* + * The array of managed applications. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The array of managed applications. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The array of managed applications. + * + * @param value the value value to set. + * @return the ApplicationListResult object itself. + */ + public ApplicationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationListResult object itself. + */ + public ApplicationListResult 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationLockLevel.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationLockLevel.java new file mode 100644 index 000000000000..a3394fae394f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationLockLevel.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The managed application lock level. */ +public enum ApplicationLockLevel { + /** Enum value CanNotDelete. */ + CAN_NOT_DELETE("CanNotDelete"), + + /** Enum value ReadOnly. */ + READ_ONLY("ReadOnly"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ApplicationLockLevel instance. */ + private final String value; + + ApplicationLockLevel(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ApplicationLockLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed ApplicationLockLevel object, or null if unable to parse. + */ + @JsonCreator + public static ApplicationLockLevel fromString(String value) { + if (value == null) { + return null; + } + ApplicationLockLevel[] items = ApplicationLockLevel.values(); + for (ApplicationLockLevel item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementMode.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementMode.java new file mode 100644 index 000000000000..33ab6fccd2a8 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementMode.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The management mode. */ +public final class ApplicationManagementMode extends ExpandableStringEnum { + /** Static value NotSpecified for ApplicationManagementMode. */ + public static final ApplicationManagementMode NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Unmanaged for ApplicationManagementMode. */ + public static final ApplicationManagementMode UNMANAGED = fromString("Unmanaged"); + + /** Static value Managed for ApplicationManagementMode. */ + public static final ApplicationManagementMode MANAGED = fromString("Managed"); + + /** + * Creates or finds a ApplicationManagementMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationManagementMode. + */ + @JsonCreator + public static ApplicationManagementMode fromString(String name) { + return fromString(name, ApplicationManagementMode.class); + } + + /** + * Gets known ApplicationManagementMode values. + * + * @return known ApplicationManagementMode values. + */ + public static Collection values() { + return values(ApplicationManagementMode.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementPolicy.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementPolicy.java new file mode 100644 index 000000000000..7c1ad27fddb1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementPolicy.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed application management policy. */ +@Fluent +public final class ApplicationManagementPolicy { + /* + * The managed application management mode. + */ + @JsonProperty(value = "mode") + private ApplicationManagementMode mode; + + /** + * Get the mode property: The managed application management mode. + * + * @return the mode value. + */ + public ApplicationManagementMode mode() { + return this.mode; + } + + /** + * Set the mode property: The managed application management mode. + * + * @param mode the mode value to set. + * @return the ApplicationManagementPolicy object itself. + */ + public ApplicationManagementPolicy withMode(ApplicationManagementMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationEndpoint.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationEndpoint.java new file mode 100644 index 000000000000..80421bd72be2 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationEndpoint.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed application notification endpoint. */ +@Fluent +public final class ApplicationNotificationEndpoint { + /* + * The managed application notification endpoint uri. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * Get the uri property: The managed application notification endpoint uri. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The managed application notification endpoint uri. + * + * @param uri the uri value to set. + * @return the ApplicationNotificationEndpoint object itself. + */ + public ApplicationNotificationEndpoint withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property uri in model ApplicationNotificationEndpoint")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationNotificationEndpoint.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationPolicy.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationPolicy.java new file mode 100644 index 000000000000..cc2600f9d9f6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationPolicy.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Managed application notification policy. */ +@Fluent +public final class ApplicationNotificationPolicy { + /* + * The managed application notification endpoint. + */ + @JsonProperty(value = "notificationEndpoints", required = true) + private List notificationEndpoints; + + /** + * Get the notificationEndpoints property: The managed application notification endpoint. + * + * @return the notificationEndpoints value. + */ + public List notificationEndpoints() { + return this.notificationEndpoints; + } + + /** + * Set the notificationEndpoints property: The managed application notification endpoint. + * + * @param notificationEndpoints the notificationEndpoints value to set. + * @return the ApplicationNotificationPolicy object itself. + */ + public ApplicationNotificationPolicy withNotificationEndpoints( + List notificationEndpoints) { + this.notificationEndpoints = notificationEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (notificationEndpoints() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property notificationEndpoints in model ApplicationNotificationPolicy")); + } else { + notificationEndpoints().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationNotificationPolicy.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageContact.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageContact.java new file mode 100644 index 000000000000..f2075ba6ef9d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageContact.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The application package contact information. */ +@Fluent +public final class ApplicationPackageContact { + /* + * The contact name. + */ + @JsonProperty(value = "contactName") + private String contactName; + + /* + * The contact email. + */ + @JsonProperty(value = "email", required = true) + private String email; + + /* + * The contact phone number. + */ + @JsonProperty(value = "phone", required = true) + private String phone; + + /** + * Get the contactName property: The contact name. + * + * @return the contactName value. + */ + public String contactName() { + return this.contactName; + } + + /** + * Set the contactName property: The contact name. + * + * @param contactName the contactName value to set. + * @return the ApplicationPackageContact object itself. + */ + public ApplicationPackageContact withContactName(String contactName) { + this.contactName = contactName; + return this; + } + + /** + * Get the email property: The contact email. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The contact email. + * + * @param email the email value to set. + * @return the ApplicationPackageContact object itself. + */ + public ApplicationPackageContact withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the phone property: The contact phone number. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone property: The contact phone number. + * + * @param phone the phone value to set. + * @return the ApplicationPackageContact object itself. + */ + public ApplicationPackageContact withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (email() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property email in model ApplicationPackageContact")); + } + if (phone() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property phone in model ApplicationPackageContact")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationPackageContact.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageLockingPolicyDefinition.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageLockingPolicyDefinition.java new file mode 100644 index 000000000000..e2db4ca68953 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageLockingPolicyDefinition.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Managed application locking policy. */ +@Fluent +public final class ApplicationPackageLockingPolicyDefinition { + /* + * The deny assignment excluded actions. + */ + @JsonProperty(value = "allowedActions") + private List allowedActions; + + /* + * The deny assignment excluded data actions. + */ + @JsonProperty(value = "allowedDataActions") + private List allowedDataActions; + + /** + * Get the allowedActions property: The deny assignment excluded actions. + * + * @return the allowedActions value. + */ + public List allowedActions() { + return this.allowedActions; + } + + /** + * Set the allowedActions property: The deny assignment excluded actions. + * + * @param allowedActions the allowedActions value to set. + * @return the ApplicationPackageLockingPolicyDefinition object itself. + */ + public ApplicationPackageLockingPolicyDefinition withAllowedActions(List allowedActions) { + this.allowedActions = allowedActions; + return this; + } + + /** + * Get the allowedDataActions property: The deny assignment excluded data actions. + * + * @return the allowedDataActions value. + */ + public List allowedDataActions() { + return this.allowedDataActions; + } + + /** + * Set the allowedDataActions property: The deny assignment excluded data actions. + * + * @param allowedDataActions the allowedDataActions value to set. + * @return the ApplicationPackageLockingPolicyDefinition object itself. + */ + public ApplicationPackageLockingPolicyDefinition withAllowedDataActions(List allowedDataActions) { + this.allowedDataActions = allowedDataActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageSupportUrls.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageSupportUrls.java new file mode 100644 index 000000000000..13f5c36e28c6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageSupportUrls.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The appliance package support URLs. */ +@Fluent +public final class ApplicationPackageSupportUrls { + /* + * The public azure support URL. + */ + @JsonProperty(value = "publicAzure") + private String publicAzure; + + /* + * The government cloud support URL. + */ + @JsonProperty(value = "governmentCloud") + private String governmentCloud; + + /** + * Get the publicAzure property: The public azure support URL. + * + * @return the publicAzure value. + */ + public String publicAzure() { + return this.publicAzure; + } + + /** + * Set the publicAzure property: The public azure support URL. + * + * @param publicAzure the publicAzure value to set. + * @return the ApplicationPackageSupportUrls object itself. + */ + public ApplicationPackageSupportUrls withPublicAzure(String publicAzure) { + this.publicAzure = publicAzure; + return this; + } + + /** + * Get the governmentCloud property: The government cloud support URL. + * + * @return the governmentCloud value. + */ + public String governmentCloud() { + return this.governmentCloud; + } + + /** + * Set the governmentCloud property: The government cloud support URL. + * + * @param governmentCloud the governmentCloud value to set. + * @return the ApplicationPackageSupportUrls object itself. + */ + public ApplicationPackageSupportUrls withGovernmentCloud(String governmentCloud) { + this.governmentCloud = governmentCloud; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPatchable.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPatchable.java new file mode 100644 index 000000000000..1bba1dd2efc4 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPatchable.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about managed application. */ +@Fluent +public final class ApplicationPatchable extends GenericResource { + /* + * The managed application properties. + */ + @JsonProperty(value = "properties") + private ApplicationProperties innerProperties; + + /* + * The plan information. + */ + @JsonProperty(value = "plan") + private PlanPatchable plan; + + /* + * The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Get the innerProperties property: The managed application properties. + * + * @return the innerProperties value. + */ + private ApplicationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the plan property: The plan information. + * + * @return the plan value. + */ + public PlanPatchable plan() { + return this.plan; + } + + /** + * Set the plan property: The plan information. + * + * @param plan the plan value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withPlan(PlanPatchable plan) { + this.plan = plan; + return this; + } + + /** + * Get the kind property: The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog. + * + * @param kind the kind value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchable withManagedBy(String managedBy) { + super.withManagedBy(managedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchable withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchable withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchable withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the managedResourceGroupId property: The managed resource group Id. + * + * @return the managedResourceGroupId value. + */ + public String managedResourceGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupId(); + } + + /** + * Set the managedResourceGroupId property: The managed resource group Id. + * + * @param managedResourceGroupId the managedResourceGroupId value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withManagedResourceGroupId(String managedResourceGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withManagedResourceGroupId(managedResourceGroupId); + return this; + } + + /** + * Get the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @return the applicationDefinitionId value. + */ + public String applicationDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().applicationDefinitionId(); + } + + /** + * Set the applicationDefinitionId property: The fully qualified path of managed application definition Id. + * + * @param applicationDefinitionId the applicationDefinitionId value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withApplicationDefinitionId(String applicationDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withApplicationDefinitionId(applicationDefinitionId); + return this; + } + + /** + * Get the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @return the parameters value. + */ + public Object parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: Name and value pairs that define the managed application parameters. It can be a + * JObject or a well formed JSON string. + * + * @param parameters the parameters value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withParameters(Object parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withParameters(parameters); + return this; + } + + /** + * Get the outputs property: Name and value pairs that define the managed application outputs. + * + * @return the outputs value. + */ + public Object outputs() { + return this.innerProperties() == null ? null : this.innerProperties().outputs(); + } + + /** + * Get the provisioningState property: The managed application provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the billingDetails property: The managed application billing details. + * + * @return the billingDetails value. + */ + public ApplicationBillingDetailsDefinition billingDetails() { + return this.innerProperties() == null ? null : this.innerProperties().billingDetails(); + } + + /** + * Get the jitAccessPolicy property: The managed application Jit access policy. + * + * @return the jitAccessPolicy value. + */ + public ApplicationJitAccessPolicy jitAccessPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().jitAccessPolicy(); + } + + /** + * Set the jitAccessPolicy property: The managed application Jit access policy. + * + * @param jitAccessPolicy the jitAccessPolicy value to set. + * @return the ApplicationPatchable object itself. + */ + public ApplicationPatchable withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationProperties(); + } + this.innerProperties().withJitAccessPolicy(jitAccessPolicy); + return this; + } + + /** + * Get the publisherTenantId property: The publisher tenant Id. + * + * @return the publisherTenantId value. + */ + public String publisherTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherTenantId(); + } + + /** + * Get the authorizations property: The read-only authorizations property that is retrieved from the application + * package. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.innerProperties() == null ? null : this.innerProperties().authorizations(); + } + + /** + * Get the managementMode property: The managed application management mode. + * + * @return the managementMode value. + */ + public ApplicationManagementMode managementMode() { + return this.innerProperties() == null ? null : this.innerProperties().managementMode(); + } + + /** + * Get the customerSupport property: The read-only customer support property that is retrieved from the application + * package. + * + * @return the customerSupport value. + */ + public ApplicationPackageContact customerSupport() { + return this.innerProperties() == null ? null : this.innerProperties().customerSupport(); + } + + /** + * Get the supportUrls property: The read-only support URLs property that is retrieved from the application package. + * + * @return the supportUrls value. + */ + public ApplicationPackageSupportUrls supportUrls() { + return this.innerProperties() == null ? null : this.innerProperties().supportUrls(); + } + + /** + * Get the artifacts property: The collection of managed application artifacts. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); + } + + /** + * Get the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + public ApplicationClientDetails createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + public ApplicationClientDetails updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPolicy.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPolicy.java new file mode 100644 index 000000000000..1aa9caaf9da7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPolicy.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed application policy. */ +@Fluent +public final class ApplicationPolicy { + /* + * The policy name + */ + @JsonProperty(value = "name") + private String name; + + /* + * The policy definition Id. + */ + @JsonProperty(value = "policyDefinitionId") + private String policyDefinitionId; + + /* + * The policy parameters. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * Get the name property: The policy name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The policy name. + * + * @param name the name value to set. + * @return the ApplicationPolicy object itself. + */ + public ApplicationPolicy withName(String name) { + this.name = name; + return this; + } + + /** + * Get the policyDefinitionId property: The policy definition Id. + * + * @return the policyDefinitionId value. + */ + public String policyDefinitionId() { + return this.policyDefinitionId; + } + + /** + * Set the policyDefinitionId property: The policy definition Id. + * + * @param policyDefinitionId the policyDefinitionId value to set. + * @return the ApplicationPolicy object itself. + */ + public ApplicationPolicy withPolicyDefinitionId(String policyDefinitionId) { + this.policyDefinitionId = policyDefinitionId; + return this; + } + + /** + * Get the parameters property: The policy parameters. + * + * @return the parameters value. + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The policy parameters. + * + * @param parameters the parameters value to set. + * @return the ApplicationPolicy object itself. + */ + public ApplicationPolicy withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Applications.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Applications.java new file mode 100644 index 000000000000..c4758c2b9189 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Applications.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; + +/** Resource collection API of Applications. */ +public interface Applications { + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application. + */ + Application getByResourceGroup(String resourceGroupName, String applicationName); + + /** + * Gets the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 managed application along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationName, Context context); + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName); + + /** + * Deletes the managed application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 applicationName, Context context); + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the applications within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed applications as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the applications 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 list of managed applications as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application. + */ + Application getById(String applicationId); + + /** + * Gets the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 the managed application along with {@link Response}. + */ + Response getByIdWithResponse(String applicationId, Context context); + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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. + */ + void deleteById(String applicationId); + + /** + * Deletes the managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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. + */ + void deleteById(String applicationId, Context context); + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + Application createOrUpdateById(String applicationId, ApplicationInner parameters); + + /** + * Creates or updates a managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to the create or update a managed application. + * @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 managed application. + */ + Application createOrUpdateById(String applicationId, ApplicationInner parameters, Context context); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + Application updateById(String applicationId, ApplicationPatchable parameters); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-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 managed application. + */ + Application updateById(String applicationId); + + /** + * Updates an existing managed application. + * + * @param applicationId The fully qualified ID of the managed application, including the managed application name + * and the managed application resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name}. + * @param parameters Parameters supplied to update an existing managed application. + * @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 managed application. + */ + Application updateById(String applicationId, ApplicationPatchable parameters, Context context); + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 refreshPermissions(String resourceGroupName, String applicationName); + + /** + * Refresh Permissions for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 refreshPermissions(String resourceGroupName, String applicationName, Context context); + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 array of plan. + */ + AllowedUpgradePlansResult listAllowedUpgradePlans(String resourceGroupName, String applicationName); + + /** + * List allowed upgrade plans for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @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 array of plan along with {@link Response}. + */ + Response listAllowedUpgradePlansWithResponse( + String resourceGroupName, String applicationName, Context context); + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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. + */ + UpdateAccessDefinition updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters); + + /** + * Update access for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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. + */ + UpdateAccessDefinition updateAccess( + String resourceGroupName, String applicationName, UpdateAccessDefinitionInner parameters, Context context); + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens. + */ + ManagedIdentityTokenResult listTokens( + String resourceGroupName, String applicationName, ListTokenRequest parameters); + + /** + * List tokens for application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationName The name of the managed application. + * @param parameters Request body parameters to list tokens. + * @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 array of managed identity tokens along with {@link Response}. + */ + Response listTokensWithResponse( + String resourceGroupName, String applicationName, ListTokenRequest parameters, Context context); + + /** + * Begins definition for a new Application resource. + * + * @param name resource name. + * @return the first stage of the new Application definition. + */ + Application.DefinitionStages.Blank define(String name); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/DeploymentMode.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/DeploymentMode.java new file mode 100644 index 000000000000..5868fea91769 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/DeploymentMode.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The deployment mode. */ +public final class DeploymentMode extends ExpandableStringEnum { + /** Static value NotSpecified for DeploymentMode. */ + public static final DeploymentMode NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Incremental for DeploymentMode. */ + public static final DeploymentMode INCREMENTAL = fromString("Incremental"); + + /** Static value Complete for DeploymentMode. */ + public static final DeploymentMode COMPLETE = fromString("Complete"); + + /** + * Creates or finds a DeploymentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentMode. + */ + @JsonCreator + public static DeploymentMode fromString(String name) { + return fromString(name, DeploymentMode.class); + } + + /** + * Gets known DeploymentMode values. + * + * @return known DeploymentMode values. + */ + public static Collection values() { + return values(DeploymentMode.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/GenericResource.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/GenericResource.java new file mode 100644 index 000000000000..349e7f2a7f79 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/GenericResource.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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; + +/** Resource information. */ +@Fluent +public class GenericResource extends Resource { + /* + * ID of the resource that manages this resource. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /* + * The SKU of the resource. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the managedBy property: ID of the resource that manages this resource. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: ID of the resource that manages this resource. + * + * @param managedBy the managedBy value to set. + * @return the GenericResource object itself. + */ + public GenericResource withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get the sku property: The SKU of the resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the resource. + * + * @param sku the sku value to set. + * @return the GenericResource object itself. + */ + public GenericResource withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * 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 GenericResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Identity.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Identity.java new file mode 100644 index 000000000000..ba914a98680d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Identity.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public class Identity { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the resource. The user identity dictionary key references will be + * resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApprovalMode.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApprovalMode.java new file mode 100644 index 000000000000..6cee0dff83f2 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApprovalMode.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The Jit approval mode. */ +public final class JitApprovalMode extends ExpandableStringEnum { + /** Static value NotSpecified for JitApprovalMode. */ + public static final JitApprovalMode NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value AutoApprove for JitApprovalMode. */ + public static final JitApprovalMode AUTO_APPROVE = fromString("AutoApprove"); + + /** Static value ManualApprove for JitApprovalMode. */ + public static final JitApprovalMode MANUAL_APPROVE = fromString("ManualApprove"); + + /** + * Creates or finds a JitApprovalMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding JitApprovalMode. + */ + @JsonCreator + public static JitApprovalMode fromString(String name) { + return fromString(name, JitApprovalMode.class); + } + + /** + * Gets known JitApprovalMode values. + * + * @return known JitApprovalMode values. + */ + public static Collection values() { + return values(JitApprovalMode.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverDefinition.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverDefinition.java new file mode 100644 index 000000000000..72f971544988 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverDefinition.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** JIT approver definition. */ +@Fluent +public final class JitApproverDefinition { + /* + * The approver service principal Id. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * The approver type. + */ + @JsonProperty(value = "type") + private JitApproverType type; + + /* + * The approver display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the id property: The approver service principal Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The approver service principal Id. + * + * @param id the id value to set. + * @return the JitApproverDefinition object itself. + */ + public JitApproverDefinition withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The approver type. + * + * @return the type value. + */ + public JitApproverType type() { + return this.type; + } + + /** + * Set the type property: The approver type. + * + * @param type the type value to set. + * @return the JitApproverDefinition object itself. + */ + public JitApproverDefinition withType(JitApproverType type) { + this.type = type; + return this; + } + + /** + * Get the displayName property: The approver display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The approver display name. + * + * @param displayName the displayName value to set. + * @return the JitApproverDefinition object itself. + */ + public JitApproverDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model JitApproverDefinition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JitApproverDefinition.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverType.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverType.java new file mode 100644 index 000000000000..b08ac67a009d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverType.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The approver type. */ +public final class JitApproverType extends ExpandableStringEnum { + /** Static value user for JitApproverType. */ + public static final JitApproverType USER = fromString("user"); + + /** Static value group for JitApproverType. */ + public static final JitApproverType GROUP = fromString("group"); + + /** + * Creates or finds a JitApproverType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JitApproverType. + */ + @JsonCreator + public static JitApproverType fromString(String name) { + return fromString(name, JitApproverType.class); + } + + /** + * Gets known JitApproverType values. + * + * @return known JitApproverType values. + */ + public static Collection values() { + return values(JitApproverType.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitAuthorizationPolicies.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitAuthorizationPolicies.java new file mode 100644 index 000000000000..29861c21c6a6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitAuthorizationPolicies.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JIT authorization policies. */ +@Fluent +public final class JitAuthorizationPolicies { + /* + * The the principal id that will be granted JIT access. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The role definition id that will be granted to the Principal. + */ + @JsonProperty(value = "roleDefinitionId", required = true) + private String roleDefinitionId; + + /** + * Get the principalId property: The the principal id that will be granted JIT access. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The the principal id that will be granted JIT access. + * + * @param principalId the principalId value to set. + * @return the JitAuthorizationPolicies object itself. + */ + public JitAuthorizationPolicies withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the roleDefinitionId property: The role definition id that will be granted to the Principal. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition id that will be granted to the Principal. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the JitAuthorizationPolicies object itself. + */ + public JitAuthorizationPolicies withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model JitAuthorizationPolicies")); + } + if (roleDefinitionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleDefinitionId in model JitAuthorizationPolicies")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JitAuthorizationPolicies.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinition.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinition.java new file mode 100644 index 000000000000..d342392484fb --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinition.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of JitRequestDefinition. */ +public interface JitRequestDefinition { + /** + * 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 applicationResourceId property: The parent application id. + * + * @return the applicationResourceId value. + */ + String applicationResourceId(); + + /** + * Gets the publisherTenantId property: The publisher tenant id. + * + * @return the publisherTenantId value. + */ + String publisherTenantId(); + + /** + * Gets the jitAuthorizationPolicies property: The JIT authorization policies. + * + * @return the jitAuthorizationPolicies value. + */ + List jitAuthorizationPolicies(); + + /** + * Gets the jitSchedulingPolicy property: The JIT request properties. + * + * @return the jitSchedulingPolicy value. + */ + JitSchedulingPolicy jitSchedulingPolicy(); + + /** + * Gets the provisioningState property: The JIT request provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the jitRequestState property: The JIT request state. + * + * @return the jitRequestState value. + */ + JitRequestState jitRequestState(); + + /** + * Gets the createdBy property: The client entity that created the JIT request. + * + * @return the createdBy value. + */ + ApplicationClientDetails createdBy(); + + /** + * Gets the updatedBy property: The client entity that last updated the JIT request. + * + * @return the updatedBy value. + */ + ApplicationClientDetails updatedBy(); + + /** + * 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.solutions.fluent.models.JitRequestDefinitionInner object. + * + * @return the inner object. + */ + JitRequestDefinitionInner innerModel(); + + /** The entirety of the JitRequestDefinition definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The JitRequestDefinition definition stages. */ + interface DefinitionStages { + /** The first stage of the JitRequestDefinition definition. */ + interface Blank extends WithLocation { + } + /** The stage of the JitRequestDefinition 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 JitRequestDefinition 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 JitRequestDefinition 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.WithApplicationResourceId, + DefinitionStages.WithJitAuthorizationPolicies, + DefinitionStages.WithJitSchedulingPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + JitRequestDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + JitRequestDefinition create(Context context); + } + /** The stage of the JitRequestDefinition 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 JitRequestDefinition definition allowing to specify applicationResourceId. */ + interface WithApplicationResourceId { + /** + * Specifies the applicationResourceId property: The parent application id.. + * + * @param applicationResourceId The parent application id. + * @return the next definition stage. + */ + WithCreate withApplicationResourceId(String applicationResourceId); + } + /** The stage of the JitRequestDefinition definition allowing to specify jitAuthorizationPolicies. */ + interface WithJitAuthorizationPolicies { + /** + * Specifies the jitAuthorizationPolicies property: The JIT authorization policies.. + * + * @param jitAuthorizationPolicies The JIT authorization policies. + * @return the next definition stage. + */ + WithCreate withJitAuthorizationPolicies(List jitAuthorizationPolicies); + } + /** The stage of the JitRequestDefinition definition allowing to specify jitSchedulingPolicy. */ + interface WithJitSchedulingPolicy { + /** + * Specifies the jitSchedulingPolicy property: The JIT request properties.. + * + * @param jitSchedulingPolicy The JIT request properties. + * @return the next definition stage. + */ + WithCreate withJitSchedulingPolicy(JitSchedulingPolicy jitSchedulingPolicy); + } + } + /** + * Begins update for the JitRequestDefinition resource. + * + * @return the stage of resource update. + */ + JitRequestDefinition.Update update(); + + /** The template for JitRequestDefinition update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + JitRequestDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + JitRequestDefinition apply(Context context); + } + /** The JitRequestDefinition update stages. */ + interface UpdateStages { + /** The stage of the JitRequestDefinition update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Jit request tags. + * + * @param tags Jit request tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + JitRequestDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + JitRequestDefinition refresh(Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinitionListResult.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinitionListResult.java new file mode 100644 index 000000000000..cb33cbc8e886 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinitionListResult.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.solutions.models; + +import com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionListResultInner; +import java.util.List; + +/** An immutable client-side representation of JitRequestDefinitionListResult. */ +public interface JitRequestDefinitionListResult { + /** + * Gets the value property: The array of Jit request definition. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.solutions.fluent.models.JitRequestDefinitionListResultInner object. + * + * @return the inner object. + */ + JitRequestDefinitionListResultInner innerModel(); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestMetadata.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestMetadata.java new file mode 100644 index 000000000000..f309e43a1ed8 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestMetadata.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The JIT request metadata. */ +@Fluent +public final class JitRequestMetadata { + /* + * The origin request id. + */ + @JsonProperty(value = "originRequestId") + private String originRequestId; + + /* + * The requestor id. + */ + @JsonProperty(value = "requestorId") + private String requestorId; + + /* + * The publisher's tenant name. + */ + @JsonProperty(value = "tenantDisplayName") + private String tenantDisplayName; + + /* + * The subject display name. + */ + @JsonProperty(value = "subjectDisplayName") + private String subjectDisplayName; + + /** + * Get the originRequestId property: The origin request id. + * + * @return the originRequestId value. + */ + public String originRequestId() { + return this.originRequestId; + } + + /** + * Set the originRequestId property: The origin request id. + * + * @param originRequestId the originRequestId value to set. + * @return the JitRequestMetadata object itself. + */ + public JitRequestMetadata withOriginRequestId(String originRequestId) { + this.originRequestId = originRequestId; + return this; + } + + /** + * Get the requestorId property: The requestor id. + * + * @return the requestorId value. + */ + public String requestorId() { + return this.requestorId; + } + + /** + * Set the requestorId property: The requestor id. + * + * @param requestorId the requestorId value to set. + * @return the JitRequestMetadata object itself. + */ + public JitRequestMetadata withRequestorId(String requestorId) { + this.requestorId = requestorId; + return this; + } + + /** + * Get the tenantDisplayName property: The publisher's tenant name. + * + * @return the tenantDisplayName value. + */ + public String tenantDisplayName() { + return this.tenantDisplayName; + } + + /** + * Set the tenantDisplayName property: The publisher's tenant name. + * + * @param tenantDisplayName the tenantDisplayName value to set. + * @return the JitRequestMetadata object itself. + */ + public JitRequestMetadata withTenantDisplayName(String tenantDisplayName) { + this.tenantDisplayName = tenantDisplayName; + return this; + } + + /** + * Get the subjectDisplayName property: The subject display name. + * + * @return the subjectDisplayName value. + */ + public String subjectDisplayName() { + return this.subjectDisplayName; + } + + /** + * Set the subjectDisplayName property: The subject display name. + * + * @param subjectDisplayName the subjectDisplayName value to set. + * @return the JitRequestMetadata object itself. + */ + public JitRequestMetadata withSubjectDisplayName(String subjectDisplayName) { + this.subjectDisplayName = subjectDisplayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestPatchable.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestPatchable.java new file mode 100644 index 000000000000..f5fabe27b1e0 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestPatchable.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Information about JIT request. */ +@Fluent +public final class JitRequestPatchable { + /* + * Jit request tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Jit request tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Jit request tags. + * + * @param tags the tags value to set. + * @return the JitRequestPatchable object itself. + */ + public JitRequestPatchable withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestState.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestState.java new file mode 100644 index 000000000000..5836e3eb65b9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestState.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The JIT request state. */ +public final class JitRequestState extends ExpandableStringEnum { + /** Static value NotSpecified for JitRequestState. */ + public static final JitRequestState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Pending for JitRequestState. */ + public static final JitRequestState PENDING = fromString("Pending"); + + /** Static value Approved for JitRequestState. */ + public static final JitRequestState APPROVED = fromString("Approved"); + + /** Static value Denied for JitRequestState. */ + public static final JitRequestState DENIED = fromString("Denied"); + + /** Static value Failed for JitRequestState. */ + public static final JitRequestState FAILED = fromString("Failed"); + + /** Static value Canceled for JitRequestState. */ + public static final JitRequestState CANCELED = fromString("Canceled"); + + /** Static value Expired for JitRequestState. */ + public static final JitRequestState EXPIRED = fromString("Expired"); + + /** Static value Timeout for JitRequestState. */ + public static final JitRequestState TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a JitRequestState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JitRequestState. + */ + @JsonCreator + public static JitRequestState fromString(String name) { + return fromString(name, JitRequestState.class); + } + + /** + * Gets known JitRequestState values. + * + * @return known JitRequestState values. + */ + public static Collection values() { + return values(JitRequestState.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequests.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequests.java new file mode 100644 index 000000000000..30565a8e44f4 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequests.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.solutions.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of JitRequests. */ +public interface JitRequests { + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 JIT request. + */ + JitRequestDefinition getByResourceGroup(String resourceGroupName, String jitRequestName); + + /** + * Gets the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 JIT request along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String jitRequestName, Context context); + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 jitRequestName); + + /** + * Deletes the JIT request. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jitRequestName The name of the JIT request. + * @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 jitRequestName, Context context); + + /** + * Lists all JIT requests within the 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 list of JIT requests. + */ + JitRequestDefinitionListResult listBySubscription(); + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response}. + */ + Response listBySubscriptionWithResponse(Context context); + + /** + * Lists all JIT requests within the 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 list of JIT requests. + */ + JitRequestDefinitionListResult listByResourceGroup(String resourceGroupName); + + /** + * Lists all JIT requests within the 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 list of JIT requests along with {@link Response}. + */ + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Gets the JIT request. + * + * @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 the JIT request along with {@link Response}. + */ + JitRequestDefinition getById(String id); + + /** + * Gets the JIT request. + * + * @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 JIT request along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the JIT request. + * + * @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 the JIT request. + * + * @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 JitRequestDefinition resource. + * + * @param name resource name. + * @return the first stage of the new JitRequestDefinition definition. + */ + JitRequestDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingPolicy.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingPolicy.java new file mode 100644 index 000000000000..1e8eda0417f0 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingPolicy.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The JIT scheduling policies. */ +@Fluent +public final class JitSchedulingPolicy { + /* + * The type of JIT schedule. + */ + @JsonProperty(value = "type", required = true) + private JitSchedulingType type; + + /* + * The required duration of the JIT request. + */ + @JsonProperty(value = "duration", required = true) + private Duration duration; + + /* + * The start time of the request. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /** + * Get the type property: The type of JIT schedule. + * + * @return the type value. + */ + public JitSchedulingType type() { + return this.type; + } + + /** + * Set the type property: The type of JIT schedule. + * + * @param type the type value to set. + * @return the JitSchedulingPolicy object itself. + */ + public JitSchedulingPolicy withType(JitSchedulingType type) { + this.type = type; + return this; + } + + /** + * Get the duration property: The required duration of the JIT request. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: The required duration of the JIT request. + * + * @param duration the duration value to set. + * @return the JitSchedulingPolicy object itself. + */ + public JitSchedulingPolicy withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the startTime property: The start time of the request. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the request. + * + * @param startTime the startTime value to set. + * @return the JitSchedulingPolicy object itself. + */ + public JitSchedulingPolicy withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model JitSchedulingPolicy")); + } + if (duration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property duration in model JitSchedulingPolicy")); + } + if (startTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property startTime in model JitSchedulingPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JitSchedulingPolicy.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingType.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingType.java new file mode 100644 index 000000000000..30fbacb7352b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingType.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The JIT request scheduling type. */ +public final class JitSchedulingType extends ExpandableStringEnum { + /** Static value NotSpecified for JitSchedulingType. */ + public static final JitSchedulingType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Once for JitSchedulingType. */ + public static final JitSchedulingType ONCE = fromString("Once"); + + /** Static value Recurring for JitSchedulingType. */ + public static final JitSchedulingType RECURRING = fromString("Recurring"); + + /** + * Creates or finds a JitSchedulingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JitSchedulingType. + */ + @JsonCreator + public static JitSchedulingType fromString(String name) { + return fromString(name, JitSchedulingType.class); + } + + /** + * Gets known JitSchedulingType values. + * + * @return known JitSchedulingType values. + */ + public static Collection values() { + return values(JitSchedulingType.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ListTokenRequest.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ListTokenRequest.java new file mode 100644 index 000000000000..854429ccda59 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ListTokenRequest.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List token request body. */ +@Fluent +public final class ListTokenRequest { + /* + * The authorization audience. + */ + @JsonProperty(value = "authorizationAudience") + private String authorizationAudience; + + /* + * The user assigned identities. + */ + @JsonProperty(value = "userAssignedIdentities") + private List userAssignedIdentities; + + /** + * Get the authorizationAudience property: The authorization audience. + * + * @return the authorizationAudience value. + */ + public String authorizationAudience() { + return this.authorizationAudience; + } + + /** + * Set the authorizationAudience property: The authorization audience. + * + * @param authorizationAudience the authorizationAudience value to set. + * @return the ListTokenRequest object itself. + */ + public ListTokenRequest withAuthorizationAudience(String authorizationAudience) { + this.authorizationAudience = authorizationAudience; + return this; + } + + /** + * Get the userAssignedIdentities property: The user assigned identities. + * + * @return the userAssignedIdentities value. + */ + public List userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The user assigned identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ListTokenRequest object itself. + */ + public ListTokenRequest withUserAssignedIdentities(List userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityToken.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityToken.java new file mode 100644 index 000000000000..847eb0b6e516 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityToken.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The managed identity token for the managed app resource. */ +@Fluent +public final class ManagedIdentityToken { + /* + * The requested access token. + */ + @JsonProperty(value = "accessToken") + private String accessToken; + + /* + * The number of seconds the access token will be valid. + */ + @JsonProperty(value = "expiresIn") + private String expiresIn; + + /* + * The timespan when the access token expires. This is represented as the number of seconds from epoch. + */ + @JsonProperty(value = "expiresOn") + private String expiresOn; + + /* + * The timespan when the access token takes effect. This is represented as the number of seconds from epoch. + */ + @JsonProperty(value = "notBefore") + private String notBefore; + + /* + * The aud (audience) the access token was request for. This is the same as what was provided in the listTokens + * request. + */ + @JsonProperty(value = "authorizationAudience") + private String authorizationAudience; + + /* + * The Azure resource ID for the issued token. This is either the managed application ID or the user-assigned + * identity ID. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The type of the token. + */ + @JsonProperty(value = "tokenType") + private String tokenType; + + /** + * Get the accessToken property: The requested access token. + * + * @return the accessToken value. + */ + public String accessToken() { + return this.accessToken; + } + + /** + * Set the accessToken property: The requested access token. + * + * @param accessToken the accessToken value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withAccessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get the expiresIn property: The number of seconds the access token will be valid. + * + * @return the expiresIn value. + */ + public String expiresIn() { + return this.expiresIn; + } + + /** + * Set the expiresIn property: The number of seconds the access token will be valid. + * + * @param expiresIn the expiresIn value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withExpiresIn(String expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Get the expiresOn property: The timespan when the access token expires. This is represented as the number of + * seconds from epoch. + * + * @return the expiresOn value. + */ + public String expiresOn() { + return this.expiresOn; + } + + /** + * Set the expiresOn property: The timespan when the access token expires. This is represented as the number of + * seconds from epoch. + * + * @param expiresOn the expiresOn value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withExpiresOn(String expiresOn) { + this.expiresOn = expiresOn; + return this; + } + + /** + * Get the notBefore property: The timespan when the access token takes effect. This is represented as the number of + * seconds from epoch. + * + * @return the notBefore value. + */ + public String notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: The timespan when the access token takes effect. This is represented as the number of + * seconds from epoch. + * + * @param notBefore the notBefore value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withNotBefore(String notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the authorizationAudience property: The aud (audience) the access token was request for. This is the same as + * what was provided in the listTokens request. + * + * @return the authorizationAudience value. + */ + public String authorizationAudience() { + return this.authorizationAudience; + } + + /** + * Set the authorizationAudience property: The aud (audience) the access token was request for. This is the same as + * what was provided in the listTokens request. + * + * @param authorizationAudience the authorizationAudience value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withAuthorizationAudience(String authorizationAudience) { + this.authorizationAudience = authorizationAudience; + return this; + } + + /** + * Get the resourceId property: The Azure resource ID for the issued token. This is either the managed application + * ID or the user-assigned identity ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Azure resource ID for the issued token. This is either the managed application + * ID or the user-assigned identity ID. + * + * @param resourceId the resourceId value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the tokenType property: The type of the token. + * + * @return the tokenType value. + */ + public String tokenType() { + return this.tokenType; + } + + /** + * Set the tokenType property: The type of the token. + * + * @param tokenType the tokenType value to set. + * @return the ManagedIdentityToken object itself. + */ + public ManagedIdentityToken withTokenType(String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityTokenResult.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityTokenResult.java new file mode 100644 index 000000000000..bebeb67745af --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityTokenResult.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.solutions.models; + +import com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner; +import java.util.List; + +/** An immutable client-side representation of ManagedIdentityTokenResult. */ +public interface ManagedIdentityTokenResult { + /** + * Gets the value property: The array of managed identity tokens. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner object. + * + * @return the inner object. + */ + ManagedIdentityTokenResultInner innerModel(); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Operation.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Operation.java new file mode 100644 index 000000000000..284fa4c9fbba --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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.solutions.models; + +import com.azure.resourcemanager.solutions.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.solutions.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationDisplay.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationDisplay.java new file mode 100644 index 000000000000..87e6a1dd8afe --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationDisplay.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationListResult.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationListResult.java new file mode 100644 index 000000000000..2f5911ed607e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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.solutions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.solutions.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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Origin.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Origin.java new file mode 100644 index 000000000000..4165d8774ff1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Origin.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Plan.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Plan.java new file mode 100644 index 000000000000..7e0355154e75 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Plan.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.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Plan for the managed application. */ +@Fluent +public final class Plan { + /* + * The plan name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The product code. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /* + * The promotion code. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The plan's version. + */ + @JsonProperty(value = "version", required = true) + private String version; + + /** + * Get the name property: The plan name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan name. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The product code. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The product code. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: The promotion code. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: The promotion code. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The plan's version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The plan's version. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Plan")); + } + if (publisher() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property publisher in model Plan")); + } + if (product() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property product in model Plan")); + } + if (version() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property version in model Plan")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Plan.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/PlanPatchable.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/PlanPatchable.java new file mode 100644 index 000000000000..a54254f0e372 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/PlanPatchable.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Plan for the managed application. */ +@Fluent +public final class PlanPatchable { + /* + * The plan name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * The product code. + */ + @JsonProperty(value = "product") + private String product; + + /* + * The promotion code. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The plan's version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the name property: The plan name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan name. + * + * @param name the name value to set. + * @return the PlanPatchable object itself. + */ + public PlanPatchable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the PlanPatchable object itself. + */ + public PlanPatchable withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The product code. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The product code. + * + * @param product the product value to set. + * @return the PlanPatchable object itself. + */ + public PlanPatchable withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: The promotion code. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: The promotion code. + * + * @param promotionCode the promotionCode value to set. + * @return the PlanPatchable object itself. + */ + public PlanPatchable withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The plan's version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The plan's version. + * + * @param version the version value to set. + * @return the PlanPatchable object itself. + */ + public PlanPatchable 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/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ProvisioningState.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ProvisioningState.java new file mode 100644 index 000000000000..e8681ee8aacb --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning status of the managed application. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ResourceIdentityType.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ResourceIdentityType.java new file mode 100644 index 000000000000..6162b34f0cfe --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ResourceIdentityType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The identity type. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** 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) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ResourceProviders.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ResourceProviders.java new file mode 100644 index 000000000000..96fb1d2aff6b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ResourceProviders.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.solutions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Lists all of the available Microsoft.Solutions 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 listOperations(); + + /** + * Lists all of the available Microsoft.Solutions 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 listOperations(Context context); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Sku.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Sku.java new file mode 100644 index 000000000000..02be4043a145 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Sku.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU for the resource. */ +@Fluent +public final class Sku { + /* + * The SKU name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The SKU tier. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The SKU size. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The SKU family. + */ + @JsonProperty(value = "family") + private String family; + + /* + * The SKU model. + */ + @JsonProperty(value = "model") + private String model; + + /* + * The SKU capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: The SKU name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The SKU name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The SKU tier. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: The SKU family. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The SKU family. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the model property: The SKU model. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Set the model property: The SKU model. + * + * @param model the model value to set. + * @return the Sku object itself. + */ + public Sku withModel(String model) { + this.model = model; + return this; + } + + /** + * Get the capacity property: The SKU capacity. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The SKU capacity. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Status.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Status.java new file mode 100644 index 000000000000..3299c70fd9fc --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Status.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.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The JIT status. */ +public final class Status extends ExpandableStringEnum { + /** Static value NotSpecified for Status. */ + public static final Status NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Elevate for Status. */ + public static final Status ELEVATE = fromString("Elevate"); + + /** Static value Remove for Status. */ + public static final Status REMOVE = fromString("Remove"); + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Substatus.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Substatus.java new file mode 100644 index 000000000000..9b3f00a15f28 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Substatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The sub status. */ +public final class Substatus extends ExpandableStringEnum { + /** Static value NotSpecified for Substatus. */ + public static final Substatus NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Approved for Substatus. */ + public static final Substatus APPROVED = fromString("Approved"); + + /** Static value Denied for Substatus. */ + public static final Substatus DENIED = fromString("Denied"); + + /** Static value Failed for Substatus. */ + public static final Substatus FAILED = fromString("Failed"); + + /** Static value Expired for Substatus. */ + public static final Substatus EXPIRED = fromString("Expired"); + + /** Static value Timeout for Substatus. */ + public static final Substatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a Substatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding Substatus. + */ + @JsonCreator + public static Substatus fromString(String name) { + return fromString(name, Substatus.class); + } + + /** + * Gets known Substatus values. + * + * @return known Substatus values. + */ + public static Collection values() { + return values(Substatus.class); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UpdateAccessDefinition.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UpdateAccessDefinition.java new file mode 100644 index 000000000000..2a6c0d766907 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UpdateAccessDefinition.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.solutions.models; + +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; + +/** An immutable client-side representation of UpdateAccessDefinition. */ +public interface UpdateAccessDefinition { + /** + * Gets the approver property: The approver name. + * + * @return the approver value. + */ + String approver(); + + /** + * Gets the metadata property: The JIT request metadata. + * + * @return the metadata value. + */ + JitRequestMetadata metadata(); + + /** + * Gets the status property: The JIT status. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the subStatus property: The JIT status. + * + * @return the subStatus value. + */ + Substatus subStatus(); + + /** + * Gets the inner com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner object. + * + * @return the inner object. + */ + UpdateAccessDefinitionInner innerModel(); +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UserAssignedResourceIdentity.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UserAssignedResourceIdentity.java new file mode 100644 index 000000000000..23797066feed --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UserAssignedResourceIdentity.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the user assigned identity that is contained within the UserAssignedIdentities dictionary on + * ResourceIdentity. + */ +@Immutable +public class UserAssignedResourceIdentity { + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of user assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of user assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/package-info.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/package-info.java new file mode 100644 index 000000000000..c1254083d693 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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 ManagedApplicationManagementClient. Managed Application Client. */ +package com.azure.resourcemanager.solutions.models; diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/package-info.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/package-info.java new file mode 100644 index 000000000000..5ce3ece78185 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/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 ManagedApplicationManagementClient. Managed Application Client. */ +package com.azure.resourcemanager.solutions; diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/module-info.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/module-info.java new file mode 100644 index 000000000000..ee75e27475a1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/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.solutions { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.solutions; + exports com.azure.resourcemanager.solutions.fluent; + exports com.azure.resourcemanager.solutions.fluent.models; + exports com.azure.resourcemanager.solutions.models; + + opens com.azure.resourcemanager.solutions.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.solutions.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateByIdSamples.java new file mode 100644 index 000000000000..952874a5e34d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateByIdSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationDefinitionInner; +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import java.util.Arrays; + +/** Samples for ApplicationDefinitions CreateOrUpdateById. */ +public final class ApplicationDefinitionsCreateOrUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplicationDefinition.json + */ + /** + * Sample code: Create or update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applicationDefinitions() + .createOrUpdateByIdWithResponse( + "rg", + "myManagedApplicationDef", + new ApplicationDefinitionInner() + .withLockLevel(ApplicationLockLevel.NONE) + .withDisplayName("myManagedApplicationDef") + .withAuthorizations( + Arrays + .asList( + new ApplicationAuthorization() + .withPrincipalId("validprincipalguid") + .withRoleDefinitionId("validroleguid"))) + .withDescription("myManagedApplicationDef description") + .withPackageFileUri("https://path/to/packagezipfile"), + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..70829f0697a6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +import com.azure.resourcemanager.solutions.models.ApplicationAuthorization; +import com.azure.resourcemanager.solutions.models.ApplicationLockLevel; +import java.util.Arrays; + +/** Samples for ApplicationDefinitions CreateOrUpdate. */ +public final class ApplicationDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplicationDefinition.json + */ + /** + * Sample code: Create or update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applicationDefinitions() + .define("myManagedApplicationDef") + .withRegion((String) null) + .withExistingResourceGroup("rg") + .withLockLevel(ApplicationLockLevel.NONE) + .withDisplayName("myManagedApplicationDef") + .withAuthorizations( + Arrays + .asList( + new ApplicationAuthorization() + .withPrincipalId("validprincipalguid") + .withRoleDefinitionId("validroleguid"))) + .withDescription("myManagedApplicationDef description") + .withPackageFileUri("https://path/to/packagezipfile") + .create(); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsDeleteByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsDeleteByIdSamples.java new file mode 100644 index 000000000000..b51630cf8ed4 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsDeleteByIdSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions DeleteById. */ +public final class ApplicationDefinitionsDeleteByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplicationDefinition.json + */ + /** + * Sample code: Deletes managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deletesManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().deleteByIdWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsDeleteSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsDeleteSamples.java new file mode 100644 index 000000000000..b847c60052cb --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsDeleteSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions Delete. */ +public final class ApplicationDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplicationDefinition.json + */ + /** + * Sample code: delete managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deleteManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().deleteWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsGetByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsGetByIdSamples.java new file mode 100644 index 000000000000..075f5a03bec0 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsGetByIdSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions GetById. */ +public final class ApplicationDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplicationDefinition.json + */ + /** + * Sample code: Get managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().getByIdWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsGetByResourceGroupSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4d5403eaa514 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsGetByResourceGroupSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions GetByResourceGroup. */ +public final class ApplicationDefinitionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplicationDefinition.json + */ + /** + * Sample code: Get managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().getByResourceGroupWithResponse("rg", "myManagedApplicationDef", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListByResourceGroupSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..61d41b0b9b64 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListByResourceGroupSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions ListByResourceGroup. */ +public final class ApplicationDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationDefinitionsByResourceGroup.json + */ + /** + * Sample code: Lists the managed application definitions in a resource group. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsTheManagedApplicationDefinitionsInAResourceGroup( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().listByResourceGroup("rg", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListSamples.java new file mode 100644 index 000000000000..154e70b16e77 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationDefinitions List. */ +public final class ApplicationDefinitionsListSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationDefinitionsBySubscription.json + */ + /** + * Sample code: Lists all the application definitions within a subscription. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllTheApplicationDefinitionsWithinASubscription( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applicationDefinitions().list(Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsUpdateByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsUpdateByIdSamples.java new file mode 100644 index 000000000000..eb309843d421 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsUpdateByIdSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ApplicationDefinitionPatchable; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ApplicationDefinitions UpdateById. */ +public final class ApplicationDefinitionsUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplicationDefinition.json + */ + /** + * Sample code: Update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applicationDefinitions() + .updateByIdWithResponse( + "rg", + "myManagedApplicationDef", + new ApplicationDefinitionPatchable().withTags(mapOf("department", "Finance")), + Context.NONE); + } + + @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/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsUpdateSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsUpdateSamples.java new file mode 100644 index 000000000000..0d473da2a218 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsUpdateSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ApplicationDefinition; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ApplicationDefinitions Update. */ +public final class ApplicationDefinitionsUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplicationDefinition.json + */ + /** + * Sample code: Update managed application definition. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateManagedApplicationDefinition( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + ApplicationDefinition resource = + manager + .applicationDefinitions() + .getByResourceGroupWithResponse("rg", "myManagedApplicationDef", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Finance")).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/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateByIdSamples.java new file mode 100644 index 000000000000..d1d764bb2ac6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateByIdSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationInner; + +/** Samples for Applications CreateOrUpdateById. */ +public final class ApplicationsCreateOrUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplicationById.json + */ + /** + * Sample code: Creates or updates a managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createsOrUpdatesAManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .createOrUpdateById( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + new ApplicationInner() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3a8a4efe6e89 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +/** Samples for Applications CreateOrUpdate. */ +public final class ApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateApplication.json + */ + /** + * Sample code: Create or update managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .define("myManagedApplication") + .withRegion((String) null) + .withExistingResourceGroup("rg") + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef") + .create(); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteByIdSamples.java new file mode 100644 index 000000000000..21d71ab16a15 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteByIdSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications DeleteById. */ +public final class ApplicationsDeleteByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplicationById.json + */ + /** + * Sample code: Deletes the managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deletesTheManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .deleteById( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteSamples.java new file mode 100644 index 000000000000..34736fff9fd7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications Delete. */ +public final class ApplicationsDeleteSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteApplication.json + */ + /** + * Sample code: Delete managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deleteManagedApplication(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().delete("rg", "myManagedApplication", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByIdSamples.java new file mode 100644 index 000000000000..333ac4f16ff5 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByIdSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications GetById. */ +public final class ApplicationsGetByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplicationById.json + */ + /** + * Sample code: Gets the managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getsTheManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .getByIdWithResponse( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByResourceGroupSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4d271ce8fa3b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByResourceGroupSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications GetByResourceGroup. */ +public final class ApplicationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getApplication.json + */ + /** + * Sample code: Get a managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getAManagedApplication(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().getByResourceGroupWithResponse("rg", "myManagedApplication", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListAllowedUpgradePlansSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListAllowedUpgradePlansSamples.java new file mode 100644 index 000000000000..fd74221207ee --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListAllowedUpgradePlansSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications ListAllowedUpgradePlans. */ +public final class ApplicationsListAllowedUpgradePlansSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listAllowedUpgradePlans.json + */ + /** + * Sample code: List allowed upgrade plans for application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listAllowedUpgradePlansForApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().listAllowedUpgradePlansWithResponse("rg", "myManagedApplication", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListByResourceGroupSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..6388ba9beb34 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListByResourceGroupSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications ListByResourceGroup. */ +public final class ApplicationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationsByResourceGroup.json + */ + /** + * Sample code: Lists all the applications within a resource group. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllTheApplicationsWithinAResourceGroup( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().listByResourceGroup("rg", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListSamples.java new file mode 100644 index 000000000000..56e526220834 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications List. */ +public final class ApplicationsListSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listApplicationsByResourceGroup.json + */ + /** + * Sample code: Lists all the applications within a subscription. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllTheApplicationsWithinASubscription( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().list(Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListTokensSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListTokensSamples.java new file mode 100644 index 000000000000..e2604d4a0d84 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListTokensSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ListTokenRequest; +import java.util.Arrays; + +/** Samples for Applications ListTokens. */ +public final class ApplicationsListTokensSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listToken.json + */ + /** + * Sample code: List tokens for application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listTokensForApplication(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .listTokensWithResponse( + "rg", + "myManagedApplication", + new ListTokenRequest() + .withAuthorizationAudience("authorizationAudience") + .withUserAssignedIdentities(Arrays.asList("IdentityOne", "IdentityTwo")), + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsRefreshPermissionsSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsRefreshPermissionsSamples.java new file mode 100644 index 000000000000..9fd1872e7c6d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsRefreshPermissionsSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for Applications RefreshPermissions. */ +public final class ApplicationsRefreshPermissionsSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/refreshApplicationPermissions.json + */ + /** + * Sample code: Refresh managed application permissions. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void refreshManagedApplicationPermissions( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.applications().refreshPermissions("rg", "myManagedApplication", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateAccessSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateAccessSamples.java new file mode 100644 index 000000000000..c5f75d4b0703 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateAccessSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +import com.azure.resourcemanager.solutions.models.JitRequestMetadata; +import com.azure.resourcemanager.solutions.models.Status; +import com.azure.resourcemanager.solutions.models.Substatus; + +/** Samples for Applications UpdateAccess. */ +public final class ApplicationsUpdateAccessSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateAccess.json + */ + /** + * Sample code: Update access for application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateAccessForApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .updateAccess( + "rg", + "myManagedApplication", + new UpdateAccessDefinitionInner() + .withApprover("amauser") + .withMetadata( + new JitRequestMetadata() + .withOriginRequestId("originRequestId") + .withRequestorId("RequestorId") + .withTenantDisplayName("TenantDisplayName") + .withSubjectDisplayName("SubjectDisplayName")) + .withStatus(Status.ELEVATE) + .withSubStatus(Substatus.APPROVED), + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateByIdSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateByIdSamples.java new file mode 100644 index 000000000000..b084d156c880 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateByIdSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.ApplicationPatchable; + +/** Samples for Applications UpdateById. */ +public final class ApplicationsUpdateByIdSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplicationById.json + */ + /** + * Sample code: Updates an existing managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updatesAnExistingManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .applications() + .updateById( + "subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication", + new ApplicationPatchable() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateSamples.java new file mode 100644 index 000000000000..fb791725f096 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.Application; + +/** Samples for Applications Update. */ +public final class ApplicationsUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateApplication.json + */ + /** + * Sample code: Updates managed application. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updatesManagedApplication( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + Application resource = + manager + .applications() + .getByResourceGroupWithResponse("rg", "myManagedApplication", Context.NONE) + .getValue(); + resource + .update() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef") + .apply(); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsCreateOrUpdateSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1c9b8a2865ca --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsCreateOrUpdateSamples.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.solutions.generated; + +import com.azure.resourcemanager.solutions.models.JitAuthorizationPolicies; +import com.azure.resourcemanager.solutions.models.JitSchedulingPolicy; +import com.azure.resourcemanager.solutions.models.JitSchedulingType; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for JitRequests CreateOrUpdate. */ +public final class JitRequestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/createOrUpdateJitRequest.json + */ + /** + * Sample code: Create or update jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void createOrUpdateJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager + .jitRequests() + .define("myJitRequest") + .withRegion((String) null) + .withExistingResourceGroup("rg") + .withApplicationResourceId( + "/subscriptions/00c76877-e316-48a7-af60-4a09fec9d43f/resourceGroups/52F30DB2/providers/Microsoft.Solutions/applications/7E193158") + .withJitAuthorizationPolicies( + Arrays + .asList( + new JitAuthorizationPolicies() + .withPrincipalId("1db8e132e2934dbcb8e1178a61319491") + .withRoleDefinitionId("ecd05a23-931a-4c38-a52b-ac7c4c583334"))) + .withJitSchedulingPolicy( + new JitSchedulingPolicy() + .withType(JitSchedulingType.ONCE) + .withDuration(Duration.parse("PT8H")) + .withStartTime(OffsetDateTime.parse("2021-04-22T05:48:30.6661804Z"))) + .create(); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsDeleteSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsDeleteSamples.java new file mode 100644 index 000000000000..cc62a2769aac --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsDeleteSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for JitRequests Delete. */ +public final class JitRequestsDeleteSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/deleteJitRequest.json + */ + /** + * Sample code: Delete jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void deleteJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().deleteWithResponse("rg", "myJitRequest", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsGetByResourceGroupSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..dde5f57193b0 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsGetByResourceGroupSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for JitRequests GetByResourceGroup. */ +public final class JitRequestsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/getJitRequest.json + */ + /** + * Sample code: Gets the jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void getsTheJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().getByResourceGroupWithResponse("rg", "myJitRequest", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListByResourceGroupSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListByResourceGroupSamples.java new file mode 100644 index 000000000000..1ffc489baf1a --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListByResourceGroupSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for JitRequests ListByResourceGroup. */ +public final class JitRequestsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listJitRequestsByResourceGroup.json + */ + /** + * Sample code: Lists all JIT requests within the resource group. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllJITRequestsWithinTheResourceGroup( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().listByResourceGroupWithResponse("rg", Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListBySubscriptionSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListBySubscriptionSamples.java new file mode 100644 index 000000000000..78a216b5ebad --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListBySubscriptionSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for JitRequests ListBySubscription. */ +public final class JitRequestsListBySubscriptionSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listJitRequestsByResourceGroup.json + */ + /** + * Sample code: Lists all JIT requests within the subscription. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listsAllJITRequestsWithinTheSubscription( + com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.jitRequests().listBySubscriptionWithResponse(Context.NONE); + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsUpdateSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsUpdateSamples.java new file mode 100644 index 000000000000..7db5370e35f2 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsUpdateSamples.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.solutions.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.solutions.models.JitRequestDefinition; +import java.util.HashMap; +import java.util.Map; + +/** Samples for JitRequests Update. */ +public final class JitRequestsUpdateSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/updateJitRequest.json + */ + /** + * Sample code: Update jit request. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void updateJitRequest(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + JitRequestDefinition resource = + manager.jitRequests().getByResourceGroupWithResponse("rg", "myJitRequest", Context.NONE).getValue(); + resource.update().withTags(mapOf("department", "Finance")).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/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ResourceProviderListOperationsSamples.java b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ResourceProviderListOperationsSamples.java new file mode 100644 index 000000000000..4a1bc71fb3ad --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ResourceProviderListOperationsSamples.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.solutions.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider ListOperations. */ +public final class ResourceProviderListOperationsSamples { + /* + * x-ms-original-file: specification/solutions/resource-manager/Microsoft.Solutions/stable/2021-07-01/examples/listSolutionsOperations.json + */ + /** + * Sample code: List Solutions operations. + * + * @param manager Entry point to ManagedApplicationManager. + */ + public static void listSolutionsOperations(com.azure.resourcemanager.solutions.ManagedApplicationManager manager) { + manager.resourceProviders().listOperations(Context.NONE); + } +} diff --git a/sdk/solutions/ci.yml b/sdk/solutions/ci.yml new file mode 100644 index 000000000000..60a5635692d4 --- /dev/null +++ b/sdk/solutions/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/solutions/ci.yml + - sdk/solutions/azure-resourcemanager-solutions/ + exclude: + - sdk/solutions/pom.xml + - sdk/solutions/azure-resourcemanager-solutions/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/solutions/ci.yml + - sdk/solutions/azure-resourcemanager-solutions/ + exclude: + - sdk/solutions/pom.xml + - sdk/solutions/azure-resourcemanager-solutions/pom.xml + +parameters: + - name: release_azureresourcemanagersolutions + displayName: azure-resourcemanager-solutions + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: solutions + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-solutions + groupId: com.azure.resourcemanager + safeName: azureresourcemanagersolutions + releaseInBatch: ${{ parameters.release_azureresourcemanagersolutions }} diff --git a/sdk/solutions/pom.xml b/sdk/solutions/pom.xml new file mode 100644 index 000000000000..d3702150624f --- /dev/null +++ b/sdk/solutions/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-solutions-service + pom + 1.0.0 + + + azure-resourcemanager-solutions + +