diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e1f8f4910998..ca20704b93c3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -429,6 +429,7 @@ com.azure.resourcemanager:azure-resourcemanager-defendereasm;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-hdinsight-containers;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-apicenter;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;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;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 6d46c835c391..236e5a7d2fa5 100644 --- a/pom.xml +++ b/pom.xml @@ -176,6 +176,7 @@ sdk/servicelinker sdk/servicenetworking sdk/signalr + sdk/solutions sdk/sphere sdk/spring sdk/spring-experimental diff --git a/sdk/solutions/azure-resourcemanager-solutions/CHANGELOG.md b/sdk/solutions/azure-resourcemanager-solutions/CHANGELOG.md new file mode 100644 index 000000000000..0131a37f7e66 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-09-05) + +- 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..f29e87d3d299 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/README.md @@ -0,0 +1,107 @@ +# 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the 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][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fsolutions%2Fazure-resourcemanager-solutions%2FREADME.png) diff --git a/sdk/solutions/azure-resourcemanager-solutions/SAMPLE.md b/sdk/solutions/azure-resourcemanager-solutions/SAMPLE.md new file mode 100644 index 000000000000..eaedca0f3fc6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/SAMPLE.md @@ -0,0 +1,880 @@ +# 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.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"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_Delete + +```java +/** 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() + .deleteByResourceGroupWithResponse("rg", "myManagedApplicationDef", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_DeleteById + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_GetById + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_GetByResourceGroup + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_List + +```java +/** 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(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_ListByResourceGroup + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationDefinitions_Update + +```java +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", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Finance")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ApplicationDefinitions_UpdateById + +```java +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")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### 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.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"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_Delete + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_DeleteById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_GetById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_GetByResourceGroup + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_List + +```java +/** 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(com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_ListAllowedUpgradePlans + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_ListByResourceGroup + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_ListTokens + +```java +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("fakeTokenPlaceholder") + .withUserAssignedIdentities(Arrays.asList("IdentityOne", "IdentityTwo")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_RefreshPermissions + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_Update + +```java +import com.azure.resourcemanager.solutions.fluent.models.ApplicationPatchableInner; + +/** 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) { + manager + .applications() + .update( + "rg", + "myManagedApplication", + new ApplicationPatchableInner() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_UpdateAccess + +```java +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), + com.azure.core.util.Context.NONE); + } +} +``` + +### Applications_UpdateById + +```java +import com.azure.resourcemanager.solutions.fluent.models.ApplicationPatchableInner; + +/** 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 ApplicationPatchableInner() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + com.azure.core.util.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 +/** 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().deleteByResourceGroupWithResponse("rg", "myJitRequest", com.azure.core.util.Context.NONE); + } +} +``` + +### JitRequests_GetByResourceGroup + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### JitRequests_ListByResourceGroup + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### JitRequests_ListBySubscription + +```java +/** 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(com.azure.core.util.Context.NONE); + } +} +``` + +### JitRequests_Update + +```java +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", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Finance")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ResourceProvider_ListOperations + +```java +/** 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(com.azure.core.util.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..82497cd88af7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-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 + 0 + 0 + true + + + + com.azure + azure-core + 1.42.0 + + + com.azure + azure-core-management + 1.11.4 + + + 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..a105cbb14a91 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/ManagedApplicationManager.java @@ -0,0 +1,333 @@ +// 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; + } + + /** + * Gets wrapped service client ManagedApplicationManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ManagedApplicationManagementClient. + */ + 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..35dba281df8b --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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..f96e0622fd3b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/ApplicationsClient.java @@ -0,0 +1,653 @@ +// 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.ApplicationPatchableInner; +import com.azure.resourcemanager.solutions.fluent.models.ManagedIdentityTokenResultInner; +import com.azure.resourcemanager.solutions.fluent.models.UpdateAccessDefinitionInner; +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. + * @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); + + /** + * 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); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, ApplicationPatchableInner> beginUpdate( + 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 the {@link SyncPoller} for polling of information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationPatchableInner> beginUpdate( + String resourceGroupName, String applicationName, ApplicationPatchableInner 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ApplicationPatchableInner 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) + ApplicationPatchableInner update( + String resourceGroupName, String applicationName, ApplicationPatchableInner 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}. + * @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); + + /** + * 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); + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, ApplicationPatchableInner> beginUpdateById(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 the {@link SyncPoller} for polling of information about managed application. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationPatchableInner> beginUpdateById( + String applicationId, ApplicationPatchableInner 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ApplicationPatchableInner 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) + ApplicationPatchableInner updateById(String applicationId, ApplicationPatchableInner 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. + * @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); + + /** + * 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); + + /** + * 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. + * @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); + + /** + * 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); +} 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..7f58759dc309 --- /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. + * @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); + + /** + * 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); + + /** + * 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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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); + + /** + * 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); +} 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..3d06b851655e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/AllowedUpgradePlansResultInner.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.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; + + /** Creates an instance of AllowedUpgradePlansResultInner class. */ + public AllowedUpgradePlansResultInner() { + } + + /** + * 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..e78053242cf4 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionInner.java @@ -0,0 +1,447 @@ +// 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(); + + /** Creates an instance of ApplicationDefinitionInner class. */ + public ApplicationDefinitionInner() { + } + + /** + * 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..2de14e507dbe --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationDefinitionProperties.java @@ -0,0 +1,466 @@ +// 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; + + /** Creates an instance of ApplicationDefinitionProperties class. */ + public ApplicationDefinitionProperties() { + } + + /** + * 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..71266e14dbb2 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationInner.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationInner class. */ + public ApplicationInner() { + } + + /** + * 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/ApplicationPatchableInner.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationPatchableInner.java new file mode 100644 index 000000000000..796a38d2843d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationPatchableInner.java @@ -0,0 +1,366 @@ +// 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.GenericResource; +import com.azure.resourcemanager.solutions.models.Identity; +import com.azure.resourcemanager.solutions.models.PlanPatchable; +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 ApplicationPatchableInner 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; + + /** Creates an instance of ApplicationPatchableInner class. */ + public ApplicationPatchableInner() { + } + + /** + * 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchableInner withManagedBy(String managedBy) { + super.withManagedBy(managedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchableInner withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchableInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationPatchableInner 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner 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 ApplicationPatchableInner object itself. + */ + public ApplicationPatchableInner 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/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..7f147ec83541 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ApplicationProperties.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.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; + + /** Creates an instance of ApplicationProperties class. */ + public ApplicationProperties() { + } + + /** + * 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..0eed923f99c9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of JitRequestDefinitionInner class. */ + public JitRequestDefinitionInner() { + } + + /** + * 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..178a6cbed3f1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestDefinitionListResultInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of JitRequestDefinitionListResultInner class. */ + public JitRequestDefinitionListResultInner() { + } + + /** + * 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..f16ba44785d7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/JitRequestProperties.java @@ -0,0 +1,214 @@ +// 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; + + /** Creates an instance of JitRequestProperties class. */ + public JitRequestProperties() { + } + + /** + * 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..ce7245cb1485 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/ManagedIdentityTokenResultInner.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.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; + + /** Creates an instance of ManagedIdentityTokenResultInner class. */ + public ManagedIdentityTokenResultInner() { + } + + /** + * 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..80ab53d3ad8b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// 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; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * 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..610e0b0ea26e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/fluent/models/UpdateAccessDefinitionInner.java @@ -0,0 +1,154 @@ +// 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; + + /** Creates an instance of UpdateAccessDefinitionInner class. */ + public UpdateAccessDefinitionInner() { + } + + /** + * 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..90e7db1a2bc5 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationDefinitionsClientImpl.java @@ -0,0 +1,1982 @@ +// 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") + public 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. + * @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(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, applicationDefinitionName, Context.NONE).getValue(); + } + + /** + * 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. + * @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(); + } + + /** + * 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) { + deleteWithResponse(resourceGroupName, applicationDefinitionName, Context.NONE); + } + + /** + * 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. + * @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(); + } + + /** + * 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 createOrUpdateWithResponse(resourceGroupName, applicationDefinitionName, parameters, Context.NONE) + .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 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. + * @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(); + } + + /** + * 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 updateWithResponse(resourceGroupName, applicationDefinitionName, parameters, Context.NONE).getValue(); + } + + /** + * 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. + * @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(); + } + + /** + * 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 getByIdWithResponse(resourceGroupName, applicationDefinitionName, Context.NONE).getValue(); + } + + /** + * 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. + * @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(); + } + + /** + * 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) { + deleteByIdWithResponse(resourceGroupName, applicationDefinitionName, Context.NONE); + } + + /** + * 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. + * @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(); + } + + /** + * 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 createOrUpdateByIdWithResponse(resourceGroupName, applicationDefinitionName, parameters, Context.NONE) + .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 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. + * @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(); + } + + /** + * 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 updateByIdWithResponse(resourceGroupName, applicationDefinitionName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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..239b88fe78c3 --- /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 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 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 deleteByResourceGroupWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, applicationDefinitionName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationDefinitionName) { + this.serviceClient().delete(resourceGroupName, applicationDefinitionName); + } + + 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 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 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 deleteByIdWithResponse( + String resourceGroupName, String applicationDefinitionName, Context context) { + return this.serviceClient().deleteByIdWithResponse(resourceGroupName, applicationDefinitionName, context); + } + + public void deleteById(String resourceGroupName, String applicationDefinitionName) { + this.serviceClient().deleteById(resourceGroupName, applicationDefinitionName); + } + + 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 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 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; + } + } + + 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; + } + } + + 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..3377400b4437 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationImpl.java @@ -0,0 +1,356 @@ +// 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.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.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; + + 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() { + return this; + } + + public Application apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createOrUpdate(resourceGroupName, applicationName, this.innerModel(), Context.NONE); + return this; + } + + public Application apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .createOrUpdate(resourceGroupName, applicationName, this.innerModel(), 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 Response listAllowedUpgradePlansWithResponse(Context context) { + return serviceManager + .applications() + .listAllowedUpgradePlansWithResponse(resourceGroupName, applicationName, context); + } + + public AllowedUpgradePlansResult listAllowedUpgradePlans() { + return serviceManager.applications().listAllowedUpgradePlans(resourceGroupName, applicationName); + } + + 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 Response listTokensWithResponse(ListTokenRequest parameters, Context context) { + return serviceManager + .applications() + .listTokensWithResponse(resourceGroupName, applicationName, parameters, context); + } + + public ManagedIdentityTokenResult listTokens(ListTokenRequest parameters) { + return serviceManager.applications().listTokens(resourceGroupName, applicationName, parameters); + } + + 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) { + this.innerModel().withKind(kind); + return this; + } + + public ApplicationImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ApplicationImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); + return this; + } + + public ApplicationImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ApplicationImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); + return this; + } + + public ApplicationImpl withIdentity(Identity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ApplicationImpl withManagedResourceGroupId(String managedResourceGroupId) { + this.innerModel().withManagedResourceGroupId(managedResourceGroupId); + return this; + } + + public ApplicationImpl withApplicationDefinitionId(String applicationDefinitionId) { + this.innerModel().withApplicationDefinitionId(applicationDefinitionId); + return this; + } + + public ApplicationImpl withParameters(Object parameters) { + this.innerModel().withParameters(parameters); + return this; + } + + public ApplicationImpl withJitAccessPolicy(ApplicationJitAccessPolicy jitAccessPolicy) { + this.innerModel().withJitAccessPolicy(jitAccessPolicy); + return this; + } +} diff --git a/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationPatchableImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationPatchableImpl.java new file mode 100644 index 000000000000..e216e1ecbe21 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationPatchableImpl.java @@ -0,0 +1,164 @@ +// 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.SystemData; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationPatchableInner; +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.PlanPatchable; +import com.azure.resourcemanager.solutions.models.ProvisioningState; +import com.azure.resourcemanager.solutions.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicationPatchableImpl implements ApplicationPatchable { + private ApplicationPatchableInner innerObject; + + private final com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager; + + ApplicationPatchableImpl( + ApplicationPatchableInner innerObject, + com.azure.resourcemanager.solutions.ManagedApplicationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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 PlanPatchable 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 ApplicationPatchableInner 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/ApplicationsClientImpl.java b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsClientImpl.java new file mode 100644 index 000000000000..1203a623b079 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsClientImpl.java @@ -0,0 +1,3351 @@ +// 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.ApplicationPatchableInner; +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.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") + public 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") ApplicationPatchableInner 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") ApplicationPatchableInner 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. + * @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(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, applicationName, Context.NONE).getValue(); + } + + /** + * 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 this.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 this.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 this.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 this.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, ApplicationPatchableInner 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, ApplicationPatchableInner 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, ApplicationPatchableInner> beginUpdateAsync( + String resourceGroupName, String applicationName, ApplicationPatchableInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, applicationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationPatchableInner.class, + ApplicationPatchableInner.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, ApplicationPatchableInner> beginUpdateAsync( + String resourceGroupName, String applicationName) { + final ApplicationPatchableInner parameters = null; + Mono>> mono = updateWithResponseAsync(resourceGroupName, applicationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationPatchableInner.class, + ApplicationPatchableInner.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, ApplicationPatchableInner> beginUpdateAsync( + String resourceGroupName, String applicationName, ApplicationPatchableInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationPatchableInner.class, + ApplicationPatchableInner.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, ApplicationPatchableInner> beginUpdate( + String resourceGroupName, String applicationName) { + final ApplicationPatchableInner parameters = null; + return this.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, ApplicationPatchableInner> beginUpdate( + String resourceGroupName, String applicationName, ApplicationPatchableInner parameters, Context context) { + return this.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, ApplicationPatchableInner 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 ApplicationPatchableInner 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, ApplicationPatchableInner 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ApplicationPatchableInner update(String resourceGroupName, String applicationName) { + final ApplicationPatchableInner 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 ApplicationPatchableInner update( + String resourceGroupName, String applicationName, ApplicationPatchableInner 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}. + * @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(); + } + + /** + * 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 getByIdWithResponse(applicationId, Context.NONE).getValue(); + } + + /** + * 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 this.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 this.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 this.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 this.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, ApplicationPatchableInner 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, ApplicationPatchableInner 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, ApplicationPatchableInner> beginUpdateByIdAsync( + String applicationId, ApplicationPatchableInner parameters) { + Mono>> mono = updateByIdWithResponseAsync(applicationId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationPatchableInner.class, + ApplicationPatchableInner.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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, ApplicationPatchableInner> beginUpdateByIdAsync( + String applicationId) { + final ApplicationPatchableInner parameters = null; + Mono>> mono = updateByIdWithResponseAsync(applicationId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationPatchableInner.class, + ApplicationPatchableInner.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, ApplicationPatchableInner> beginUpdateByIdAsync( + String applicationId, ApplicationPatchableInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateByIdWithResponseAsync(applicationId, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationPatchableInner.class, + ApplicationPatchableInner.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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, ApplicationPatchableInner> beginUpdateById( + String applicationId) { + final ApplicationPatchableInner parameters = null; + return this.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, ApplicationPatchableInner> beginUpdateById( + String applicationId, ApplicationPatchableInner parameters, Context context) { + return this.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, ApplicationPatchableInner 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 ApplicationPatchableInner 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, ApplicationPatchableInner 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ApplicationPatchableInner updateById(String applicationId) { + final ApplicationPatchableInner 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 ApplicationPatchableInner updateById( + String applicationId, ApplicationPatchableInner 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 this.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 this.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. + * @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(); + } + + /** + * 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 listAllowedUpgradePlansWithResponse(resourceGroupName, applicationName, Context.NONE).getValue(); + } + + /** + * 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 this.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 this.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. + * @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(); + } + + /** + * 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 listTokensWithResponse(resourceGroupName, applicationName, parameters, Context.NONE).getValue(); + } + + /** + * 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..27437696116c --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/ApplicationsImpl.java @@ -0,0 +1,270 @@ +// 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.ApplicationPatchableInner; +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 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 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 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 ApplicationPatchable update(String resourceGroupName, String applicationName) { + ApplicationPatchableInner inner = this.serviceClient().update(resourceGroupName, applicationName); + if (inner != null) { + return new ApplicationPatchableImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationPatchable update( + String resourceGroupName, String applicationName, ApplicationPatchableInner parameters, Context context) { + ApplicationPatchableInner inner = + this.serviceClient().update(resourceGroupName, applicationName, parameters, context); + if (inner != null) { + return new ApplicationPatchableImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 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 Application getById(String applicationId) { + ApplicationInner inner = this.serviceClient().getById(applicationId); + if (inner != null) { + return new ApplicationImpl(inner, 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 ApplicationPatchable updateById(String applicationId) { + ApplicationPatchableInner inner = this.serviceClient().updateById(applicationId); + if (inner != null) { + return new ApplicationPatchableImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationPatchable updateById( + String applicationId, ApplicationPatchableInner parameters, Context context) { + ApplicationPatchableInner inner = this.serviceClient().updateById(applicationId, parameters, context); + if (inner != null) { + return new ApplicationPatchableImpl(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 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 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 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 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; + } + } + + 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; + } + } + + 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..95793bdad36c --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsClientImpl.java @@ -0,0 +1,1098 @@ +// 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") + public 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. + * @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(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, jitRequestName, Context.NONE).getValue(); + } + + /** + * 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 this.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 this.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. + * @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(); + } + + /** + * 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 updateWithResponse(resourceGroupName, jitRequestName, parameters, Context.NONE).getValue(); + } + + /** + * 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. + * @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(); + } + + /** + * 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) { + deleteWithResponse(resourceGroupName, jitRequestName, Context.NONE); + } + + /** + * 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. + * + * @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 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 listBySubscriptionWithResponse(Context.NONE).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 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. + * @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(); + } + + /** + * 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 listByResourceGroupWithResponse(resourceGroupName, Context.NONE).getValue(); + } +} 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..d4e3af7b7485 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/implementation/JitRequestsImpl.java @@ -0,0 +1,198 @@ +// 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 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 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 deleteByResourceGroupWithResponse( + String resourceGroupName, String jitRequestName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, jitRequestName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String jitRequestName) { + this.serviceClient().delete(resourceGroupName, jitRequestName); + } + + 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 listBySubscription() { + JitRequestDefinitionListResultInner inner = this.serviceClient().listBySubscription(); + 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 JitRequestDefinitionListResult listByResourceGroup(String resourceGroupName) { + JitRequestDefinitionListResultInner inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return new JitRequestDefinitionListResultImpl(inner, 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.deleteByResourceGroupWithResponse(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.deleteByResourceGroupWithResponse(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..dbdcc4f50890 --- /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, + this.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..8512da9e51cb --- /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") + public 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..a3f5f59d9a4c --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ActionType.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; + +/** 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 a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * 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..03d41ece1970 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Application.java @@ -0,0 +1,672 @@ +// 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(Plan 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. + * + * @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); + + /** + * 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(); + + /** + * 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. + * @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); + + /** + * 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); +} 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..bc77cb487b32 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifact.java @@ -0,0 +1,120 @@ +// 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; + + /** Creates an instance of ApplicationArtifact class. */ + public ApplicationArtifact() { + } + + /** + * 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..1ebe4e04d0e9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationArtifactName.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.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 a new instance of ApplicationArtifactName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationArtifactName() { + } + + /** + * 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..b9b1dfbe3085 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationAuthorization.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationAuthorization class. */ + public ApplicationAuthorization() { + } + + /** + * 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..1d412305ee98 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationBillingDetailsDefinition.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.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; + + /** Creates an instance of ApplicationBillingDetailsDefinition class. */ + public ApplicationBillingDetailsDefinition() { + } + + /** + * 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..8d279d306b37 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationClientDetails.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationClientDetails class. */ + public ApplicationClientDetails() { + } + + /** + * 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..3d6f2a6c7a4d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinition.java @@ -0,0 +1,556 @@ +// 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..cf0ab998ad38 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifact.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.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; + + /** Creates an instance of ApplicationDefinitionArtifact class. */ + public ApplicationDefinitionArtifact() { + } + + /** + * 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..4c17f4b505c1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionArtifactName.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.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 a new instance of ApplicationDefinitionArtifactName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationDefinitionArtifactName() { + } + + /** + * 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..20fffe1c1b2b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationDefinitionListResult class. */ + public ApplicationDefinitionListResult() { + } + + /** + * 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..c992385da3cb --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitionPatchable.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.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; + + /** Creates an instance of ApplicationDefinitionPatchable class. */ + public ApplicationDefinitionPatchable() { + } + + /** + * 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..a325133a898e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDefinitions.java @@ -0,0 +1,229 @@ +// 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. + * @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); + + /** + * 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); + + /** + * 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 deleteByResourceGroupWithResponse( + 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); + + /** + * 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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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..ddcff6d5334d --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationDeploymentPolicy.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; + +/** Managed application deployment policy. */ +@Fluent +public final class ApplicationDeploymentPolicy { + /* + * The managed application deployment mode. + */ + @JsonProperty(value = "deploymentMode", required = true) + private DeploymentMode deploymentMode; + + /** Creates an instance of ApplicationDeploymentPolicy class. */ + public ApplicationDeploymentPolicy() { + } + + /** + * 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..093a9146e9f8 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationJitAccessPolicy.java @@ -0,0 +1,134 @@ +// 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; + + /** Creates an instance of ApplicationJitAccessPolicy class. */ + public ApplicationJitAccessPolicy() { + } + + /** + * 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..b56648fe7b26 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationListResult class. */ + public ApplicationListResult() { + } + + /** + * 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..99ccd4c82c45 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementMode.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 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 a new instance of ApplicationManagementMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationManagementMode() { + } + + /** + * 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..457be7f724c1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationManagementPolicy.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.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; + + /** Creates an instance of ApplicationManagementPolicy class. */ + public ApplicationManagementPolicy() { + } + + /** + * 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..6edc1a490bf1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationEndpoint.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; + +/** Managed application notification endpoint. */ +@Fluent +public final class ApplicationNotificationEndpoint { + /* + * The managed application notification endpoint uri. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** Creates an instance of ApplicationNotificationEndpoint class. */ + public ApplicationNotificationEndpoint() { + } + + /** + * 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..880370bcce8e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationNotificationPolicy.java @@ -0,0 +1,63 @@ +// 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; + + /** Creates an instance of ApplicationNotificationPolicy class. */ + public ApplicationNotificationPolicy() { + } + + /** + * 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..0ae27f8aa6d1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageContact.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationPackageContact class. */ + public ApplicationPackageContact() { + } + + /** + * 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..8c1d139c0ff2 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageLockingPolicyDefinition.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.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; + + /** Creates an instance of ApplicationPackageLockingPolicyDefinition class. */ + public ApplicationPackageLockingPolicyDefinition() { + } + + /** + * 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..30195fe4df58 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPackageSupportUrls.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.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; + + /** Creates an instance of ApplicationPackageSupportUrls class. */ + public ApplicationPackageSupportUrls() { + } + + /** + * 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..5f24a6ecb03f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPatchable.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.solutions.fluent.models.ApplicationPatchableInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicationPatchable. */ +public interface ApplicationPatchable { + /** + * 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. + */ + PlanPatchable 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 inner com.azure.resourcemanager.solutions.fluent.models.ApplicationPatchableInner object. + * + * @return the inner object. + */ + ApplicationPatchableInner innerModel(); +} 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..211886d92146 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ApplicationPolicy.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ApplicationPolicy class. */ + public ApplicationPolicy() { + } + + /** + * 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..97ca52b347af --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Applications.java @@ -0,0 +1,358 @@ +// 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.ApplicationPatchableInner; +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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + ApplicationPatchable 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. + */ + ApplicationPatchable update( + String resourceGroupName, String applicationName, ApplicationPatchableInner 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}. + */ + 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}. + * @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); + + /** + * 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); + + /** + * 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}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + ApplicationPatchable 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. + */ + ApplicationPatchable updateById(String applicationId, ApplicationPatchableInner 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. + * @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); + + /** + * 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); + + /** + * 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. + * @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); + + /** + * 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); + + /** + * 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..e041b1a5896b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/DeploymentMode.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 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 a new instance of DeploymentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentMode() { + } + + /** + * 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..120b85f0d0e6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/GenericResource.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.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; + + /** Creates an instance of GenericResource class. */ + public GenericResource() { + } + + /** + * 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..e3ca30e496e9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Identity.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 final 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; + + /** Creates an instance of Identity class. */ + public Identity() { + } + + /** + * 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..307e1b65b613 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApprovalMode.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 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 a new instance of JitApprovalMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JitApprovalMode() { + } + + /** + * 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..77aa6db2c720 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverDefinition.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of JitApproverDefinition class. */ + public JitApproverDefinition() { + } + + /** + * 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..b5a1b1356b2f --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitApproverType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 a new instance of JitApproverType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JitApproverType() { + } + + /** + * 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..db1b757d8bc1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitAuthorizationPolicies.java @@ -0,0 +1,91 @@ +// 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; + + /** Creates an instance of JitAuthorizationPolicies class. */ + public JitAuthorizationPolicies() { + } + + /** + * 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..53465ef86fc6 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestDefinition.java @@ -0,0 +1,309 @@ +// 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..3a2fe56b435b --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestMetadata.java @@ -0,0 +1,128 @@ +// 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; + + /** Creates an instance of JitRequestMetadata class. */ + public JitRequestMetadata() { + } + + /** + * 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..7fc16f5058c9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestPatchable.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.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; + + /** Creates an instance of JitRequestPatchable class. */ + public JitRequestPatchable() { + } + + /** + * 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..09e15feaf933 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitRequestState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 a new instance of JitRequestState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JitRequestState() { + } + + /** + * 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..6a5b72d2e327 --- /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. + * @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); + + /** + * 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); + + /** + * 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 deleteByResourceGroupWithResponse(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); + + /** + * 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 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 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); + + /** + * 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); + + /** + * 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..03d24b8baa43 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingPolicy.java @@ -0,0 +1,122 @@ +// 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; + + /** Creates an instance of JitSchedulingPolicy class. */ + public JitSchedulingPolicy() { + } + + /** + * 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..8eec3bbd799e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/JitSchedulingType.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 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 a new instance of JitSchedulingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JitSchedulingType() { + } + + /** + * 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..8d2527aee8a1 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ListTokenRequest.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.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; + + /** Creates an instance of ListTokenRequest class. */ + public ListTokenRequest() { + } + + /** + * 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..9a9711550b64 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ManagedIdentityToken.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of ManagedIdentityToken class. */ + public ManagedIdentityToken() { + } + + /** + * 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..fb47e18e7b46 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// 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; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * 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..86fb65241d2c --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * 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..73426b342548 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Origin.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.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 a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * 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..3353f3b18e88 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Plan.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** Creates an instance of Plan class. */ + public Plan() { + } + + /** + * 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..990e3d79f859 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/PlanPatchable.java @@ -0,0 +1,154 @@ +// 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; + + /** Creates an instance of PlanPatchable class. */ + public PlanPatchable() { + } + + /** + * 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..91f111ee49d3 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/ProvisioningState.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @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..b9ed3d1f5264 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Sku.java @@ -0,0 +1,187 @@ +// 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; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * 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..a2a064ce85ff --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Status.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 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 a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * 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..32e9c623a0e7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/Substatus.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; + +/** 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 a new instance of Substatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Substatus() { + } + + /** + * 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..8c04eb690b78 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/main/java/com/azure/resourcemanager/solutions/models/UserAssignedResourceIdentity.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.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 final 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; + + /** Creates an instance of UserAssignedResourceIdentity class. */ + public UserAssignedResourceIdentity() { + } + + /** + * 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..9c3dc3af6fb9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsCreateOrUpdateByIdSamples.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.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"), + com.azure.core.util.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..003492b5bee5 --- /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; + +/** 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", com.azure.core.util.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..c1e9a944ebb6 --- /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; + +/** 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() + .deleteByResourceGroupWithResponse("rg", "myManagedApplicationDef", com.azure.core.util.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..8361aedcf7e0 --- /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; + +/** 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", com.azure.core.util.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..820c37708223 --- /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; + +/** 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", com.azure.core.util.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..2d38e6e9d4ec --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// 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 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", com.azure.core.util.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..19d25392b512 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationDefinitionsListSamples.java @@ -0,0 +1,21 @@ +// 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 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(com.azure.core.util.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..b54da03333d2 --- /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.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")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..2652b7d4ff08 --- /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.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", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Finance")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..f45b2fa1aebd --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsCreateOrUpdateByIdSamples.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.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"), + com.azure.core.util.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..eb41c7d0c394 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteByIdSamples.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.generated; + +/** 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", + com.azure.core.util.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..cac6b6a4ad93 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsDeleteSamples.java @@ -0,0 +1,20 @@ +// 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 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", com.azure.core.util.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..def9097c49ef --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsGetByIdSamples.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.generated; + +/** 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", + com.azure.core.util.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..1c7a446287ef --- /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; + +/** 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", com.azure.core.util.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..9cce55a0168e --- /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; + +/** 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", com.azure.core.util.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..142b203e6034 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// 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 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", com.azure.core.util.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..69acb42901d0 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListSamples.java @@ -0,0 +1,21 @@ +// 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 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(com.azure.core.util.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..1757b76859e9 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsListTokensSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.solutions.generated; + +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("fakeTokenPlaceholder") + .withUserAssignedIdentities(Arrays.asList("IdentityOne", "IdentityTwo")), + com.azure.core.util.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..8554abc89b14 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsRefreshPermissionsSamples.java @@ -0,0 +1,21 @@ +// 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 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", com.azure.core.util.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..2da82081f29e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateAccessSamples.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.generated; + +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), + com.azure.core.util.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..24776e0d7f85 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateByIdSamples.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.resourcemanager.solutions.fluent.models.ApplicationPatchableInner; + +/** 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 ApplicationPatchableInner() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + com.azure.core.util.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..f85119848530 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ApplicationsUpdateSamples.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.resourcemanager.solutions.fluent.models.ApplicationPatchableInner; + +/** 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) { + manager + .applications() + .update( + "rg", + "myManagedApplication", + new ApplicationPatchableInner() + .withKind("ServiceCatalog") + .withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG") + .withApplicationDefinitionId( + "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), + com.azure.core.util.Context.NONE); + } +} 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..4f6b3067a888 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsDeleteSamples.java @@ -0,0 +1,20 @@ +// 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 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().deleteByResourceGroupWithResponse("rg", "myJitRequest", com.azure.core.util.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..3143513bac5c --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// 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 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", com.azure.core.util.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..917aa0e2291e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// 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 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", com.azure.core.util.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..0b53d335c0c7 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsListBySubscriptionSamples.java @@ -0,0 +1,21 @@ +// 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 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(com.azure.core.util.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..c4e3f47b585e --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/JitRequestsUpdateSamples.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.generated; + +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", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("department", "Finance")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..f6694ee29731 --- /dev/null +++ b/sdk/solutions/azure-resourcemanager-solutions/src/samples/java/com/azure/resourcemanager/solutions/generated/ResourceProviderListOperationsSamples.java @@ -0,0 +1,20 @@ +// 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 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(com.azure.core.util.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 + +